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(void* ptr, Flag!"Take" take)
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.ActionGroup.addActionWithAccel.

Members

Functions

connectToggled
gulong connectToggled(T callback, Flag!"After" after)

Connect to Toggled signal.

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.

self
ToggleAction self()

Returns this, for use in with statements.

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.

Properties

_gType
GType _gType [@property getter]
active
bool active [@property getter]

Get active property.

active
bool active [@property setter]

Set active property.

drawAsRadio
bool drawAsRadio [@property getter]

Get drawAsRadio property.

drawAsRadio
bool drawAsRadio [@property setter]

Set drawAsRadio property.

Static functions

_getGType
GType _getGType()
builder
ToggleActionGidBuilder builder()

Get builder for gtk.toggle_action.ToggleAction

Inherited Members

From Action

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Action self()

Returns this, for use in with statements.

builder
ActionGidBuilder builder()

Get builder for gtk.action.Action

actionGroup
gtk.action_group.ActionGroup actionGroup [@property getter]

Get actionGroup property.

actionGroup
gtk.action_group.ActionGroup actionGroup [@property setter]

Set actionGroup property.

alwaysShowImage
bool alwaysShowImage [@property getter]

Get alwaysShowImage property.

alwaysShowImage
bool alwaysShowImage [@property setter]

Set alwaysShowImage property.

gicon
gio.icon.Icon gicon [@property getter]

Get gicon property.

gicon
gio.icon.Icon gicon [@property setter]

Set gicon property.

hideIfEmpty
bool hideIfEmpty [@property getter]

Get hideIfEmpty property.

hideIfEmpty
bool hideIfEmpty [@property setter]

Set hideIfEmpty property.

iconName
string iconName [@property getter]

Get iconName property.

iconName
string iconName [@property setter]

Set iconName property.

isImportant
bool isImportant [@property getter]

Get isImportant property.

isImportant
bool isImportant [@property setter]

Set isImportant property.

label
string label [@property getter]

Get label property.

label
string label [@property setter]

Set label property.

name
string name [@property getter]

Get name property.

sensitive
bool sensitive [@property getter]

Get sensitive property.

sensitive
bool sensitive [@property setter]

Set sensitive property.

shortLabel
string shortLabel [@property getter]

Get shortLabel property.

shortLabel
string shortLabel [@property setter]

Set shortLabel property.

stockId
string stockId [@property getter]

Get stockId property.

stockId
string stockId [@property setter]

Set stockId property.

tooltip
string tooltip [@property getter]

Get tooltip property.

tooltip
string tooltip [@property setter]

Set tooltip property.

visible
bool visible [@property getter]

Get visible property.

visible
bool visible [@property setter]

Set visible property.

visibleHorizontal
bool visibleHorizontal [@property getter]

Get visibleHorizontal property.

visibleHorizontal
bool visibleHorizontal [@property setter]

Set visibleHorizontal property.

visibleOverflown
bool visibleOverflown [@property getter]

Get visibleOverflown property.

visibleOverflown
bool visibleOverflown [@property setter]

Set visibleOverflown property.

visibleVertical
bool visibleVertical [@property getter]

Get visibleVertical property.

visibleVertical
bool visibleVertical [@property setter]

Set visibleVertical property.

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

createIcon
gtk.widget.Widget createIcon(gtk.types.IconSize iconSize)

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

createMenu
gtk.widget.Widget 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.

createMenuItem
gtk.widget.Widget createMenuItem()

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

createToolItem
gtk.widget.Widget createToolItem()

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

disconnectAccelerator
void disconnectAccelerator()

Undoes the effect of one call to gtk.action.Action.connectAccelerator.

getAccelClosure
gobject.closure.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
gio.icon.Icon 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
gtk.widget.Widget[] getProxies()

Returns the proxy widgets for an action. See also gtk.activatable.Activatable.getRelatedAction.

getSensitive
bool getSensitive()

Returns whether the action itself is sensitive. Note that this doesn’t necessarily mean effective sensitivity. See gtk.action.Action.isSensitive for that.

getShortLabel
string getShortLabel()

Gets the short label text of action.

getStockId
string getStockId()

Gets the stock id 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.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(gtk.accel_group.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(gio.icon.Icon 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.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 gtk.action.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

connectActivate
gulong connectActivate(T callback, Flag!"After" after)

Connect to Activate signal.