ToggleAction

A #GtkToggleAction corresponds roughly to a #GtkCheckMenuItem. It has an “active” state specifying whether the action has been checked or not.

Constructors

this
this(GtkToggleAction* gtkToggleAction, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string name, string label, string tooltip, StockID stockId)

Creates a new ToggleAction object. To add the action to a ActionGroup and set the accelerator for the action, call gtk.ActionGroup.ActionGroup.addActionWithAccel().

this
this(string name, string label, string tooltip, string stockId)

Creates a new #GtkToggleAction object. To add the action to a #GtkActionGroup and set the accelerator for the action, call gtk_action_group_add_action_with_accel().

Members

Functions

addOnToggled
void addOnToggled(void delegate(ToggleAction) dlg, ConnectFlags connectFlags)

Should be connected if you wish to perform an action whenever the #GtkToggleAction state is changed.

getActive
bool getActive()

Returns the checked state of the toggle action.

getDrawAsRadio
bool getDrawAsRadio()

Returns whether the action should have proxies like a radio action.

getStruct
void* getStruct()

the main Gtk struct as a void*

getToggleActionStruct
GtkToggleAction* getToggleActionStruct()

Get the main Gtk struct

setActive
void setActive(bool isActive)

Sets the checked state on the toggle action.

setDrawAsRadio
void setDrawAsRadio(bool drawAsRadio)

Sets whether the action should have proxies like a radio action.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
toggled
void toggled()

Emits the “toggled” signal on the toggle action.

Static functions

callBackToggled
void callBackToggled(GtkToggleAction* toggleactionStruct, ToggleAction _toggleaction)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
GType getType()

Variables

connectedSignals
int[string] connectedSignals;
Undocumented in source.
gtkToggleAction
GtkToggleAction* gtkToggleAction;

the main Gtk struct

onToggledListeners
void delegate(ToggleAction)[] onToggledListeners;
Undocumented in source.

Inherited Members

From Action

gtkAction
GtkAction* gtkAction;

the main Gtk struct

getActionStruct
GtkAction* getActionStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
__anonymous
mixin BuildableT!(GtkAction)
Undocumented in source.
getStockId
StockID getStockId()

Gets the stock id of action. Since 2.16

setStockId
void setStockId(StockID stockId)

Sets the stock id on action Since 2.16

createIcon
Image createIcon(GtkIconSize iconSize)

This function is intended for use by action implementations to create icons displayed in the proxy widgets. Since 2.4

createMenuItem
MenuItem createMenuItem()

Creates a menu item widget that proxies for the given action. Since 2.4

createToolItem
ToolItem createToolItem()

Creates a toolbar item widget that proxies for the given action. Since 2.4

createMenu
Menu createMenu()

If action provides a GtkMenu widget as a submenu for the menu item or the toolbar item it creates, this function returns an instance of that menu. Since 2.12

getType
GType getType()
activate
void activate()

Emits the “activate” signal on the specified action, if it isn't insensitive. This gets called by the proxy widgets when they get activated.

blockActivate
void blockActivate()

Disable activation signals from the action

connectAccelerator
void connectAccelerator()

Installs the accelerator for @action if @action has an accel path and group. See gtk_action_set_accel_path() and gtk_action_set_accel_group()

disconnectAccelerator
void disconnectAccelerator()

Undoes the effect of one call to gtk_action_connect_accelerator().

getAccelClosure
Closure getAccelClosure()

Returns the accel closure for this action.

getAccelPath
string getAccelPath()

Returns the accel path for this action.

getAlwaysShowImage
bool getAlwaysShowImage()

Returns whether @action's menu item proxies will always show their image, if available.

getGicon
IconIF getGicon()

Gets the gicon of @action.

getIconName
string getIconName()

Gets the icon name of @action.

getIsImportant
bool getIsImportant()

Checks whether @action is important or not

getLabel
string getLabel()

Gets the label text of @action.

getName
string getName()

Returns the name of the action.

getProxies
ListSG getProxies()

Returns the proxy widgets for an action. See also gtk_activatable_get_related_action().

getSensitive
bool getSensitive()

Returns whether the action itself is sensitive. Note that this doesn’t necessarily mean effective sensitivity. See gtk_action_is_sensitive() for that.

getShortLabel
string getShortLabel()

Gets the short label text of @action.

getTooltip
string getTooltip()

Gets the tooltip text of @action.

getVisible
bool getVisible()

Returns whether the action itself is visible. Note that this doesn’t necessarily mean effective visibility. See gtk_action_is_sensitive() for that.

getVisibleHorizontal
bool getVisibleHorizontal()

Checks whether @action is visible when horizontal

getVisibleVertical
bool getVisibleVertical()

Checks whether @action is visible when horizontal

isSensitive
bool isSensitive()

Returns whether the action is effectively sensitive.

isVisible
bool isVisible()

Returns whether the action is effectively visible.

setAccelGroup
void setAccelGroup(AccelGroup accelGroup)

Sets the #GtkAccelGroup in which the accelerator for this action will be installed.

setAccelPath
void setAccelPath(string accelPath)

Sets the accel path for this action. All proxy widgets associated with the action will have this accel path, so that their accelerators are consistent.

setAlwaysShowImage
void setAlwaysShowImage(bool alwaysShow)

Sets whether @action's menu item proxies will ignore the #GtkSettings:gtk-menu-images setting and always show their image, if available.

setGicon
void setGicon(IconIF icon)

Sets the icon of @action.

setIconName
void setIconName(string iconName)

Sets the icon name on @action

setIsImportant
void setIsImportant(bool isImportant)

Sets whether the action is important, this attribute is used primarily by toolbar items to decide whether to show a label or not.

setLabel
void setLabel(string label)

Sets the label of @action.

setSensitive
void setSensitive(bool sensitive)

Sets the :sensitive property of the action to @sensitive. Note that this doesn’t necessarily mean effective sensitivity. See gtk_action_is_sensitive() for that.

setShortLabel
void setShortLabel(string shortLabel)

Sets a shorter label text on @action.

setStockId
void setStockId(string stockId)

Sets the stock id on @action

setTooltip
void setTooltip(string tooltip)

Sets the tooltip text on @action

setVisible
void setVisible(bool visible)

Sets the :visible property of the action to @visible. Note that this doesn’t necessarily mean effective visibility. See gtk_action_is_visible() for that.

setVisibleHorizontal
void setVisibleHorizontal(bool visibleHorizontal)

Sets whether @action is visible when horizontal

setVisibleVertical
void setVisibleVertical(bool visibleVertical)

Sets whether @action is visible when vertical

unblockActivate
void unblockActivate()

Reenable activation signals from the action

connectedSignals
int[string] connectedSignals;
Undocumented in source.
onActivateListeners
void delegate(Action)[] onActivateListeners;
Undocumented in source.
addOnActivate
void addOnActivate(void delegate(Action) dlg, ConnectFlags connectFlags)

The "activate" signal is emitted when the action is activated.

callBackActivate
void callBackActivate(GtkAction* actionStruct, Action _action)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta