ToggleAction

A gtk.ToggleAction corresponds roughly to a gtk.CheckMenuItem 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 gtk.ToggleAction object. To add the action to a gtk.ActionGroup and set the accelerator for the action, call Action.groupAddActionWithAccel.

Members

Functions

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

Should be connected if you wish to perform an action whenever the gtk.ToggleAction 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(bool transferOwnership)

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.

toggled
void toggled()

Emits the “toggled” signal on the toggle action.

Static functions

getType
GType getType()

Variables

gtkToggleAction
GtkToggleAction* gtkToggleAction;

the main Gtk struct

Inherited Members

From Action

gtkAction
GtkAction* gtkAction;

the main Gtk struct

getActionStruct
GtkAction* getActionStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

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 Action.setAccelPath and Action.setAccelGroup

disconnectAccelerator
void disconnectAccelerator()

Undoes the effect of one call to Action.connectAccelerator.

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 Action.isSensitive 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 Action.isSensitive 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 gtk.AccelGroup 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 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 Action.isSensitive

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 Action.isVisible

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

addOnActivate
gulong addOnActivate(void delegate(Action) dlg, ConnectFlags connectFlags)

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