Description Methods and Functions Hierarchy Interfaces Detailed Description Structures Convenient Construction Signals Properties Author(s) References See Also
An action which can be triggered by a menu or toolbar item
gtkActionNew(name = NULL, label = NULL, tooltip = NULL, stock.id = NULL)
gtkActionGetName(object)
gtkActionIsSensitive(object)
gtkActionGetSensitive(object)
gtkActionSetSensitive(object, sensitive)
gtkActionIsVisible(object)
gtkActionGetVisible(object)
gtkActionSetVisible(object, visible)
gtkActionActivate(object)
gtkActionCreateIcon(object, icon.size)
gtkActionCreateMenuItem(object)
gtkActionCreateToolItem(object)
gtkActionCreateMenu(object)
gtkActionConnectProxy(object, proxy)
gtkActionConnectProxy(object, proxy)
gtkActionDisconnectProxy(object, proxy)
gtkActionDisconnectProxy(object, proxy)
gtkActionGetProxies(object)
gtkActionConnectAccelerator(object)
gtkActionDisconnectAccelerator(object)
gtkActionBlockActivate(object)
gtkActionUnblockActivate(object)
gtkActionBlockActivateFrom(object, proxy)
gtkActionBlockActivateFrom(object, proxy)
gtkActionUnblockActivateFrom(object, proxy)
gtkActionUnblockActivateFrom(object, proxy)
gtkActionGetAlwaysShowImage(object)
gtkActionSetAlwaysShowImage(object, always.show)
gtkActionGetAccelPath(object)
gtkActionSetAccelPath(object, accel.path)
gtkActionGetAccelClosure(object)
gtkActionSetAccelGroup(object, accel.group)
gtkActionSetLabel(object, label)
gtkActionGetLabel(object)
gtkActionSetShortLabel(object, short.label)
gtkActionGetShortLabel(object)
gtkActionSetTooltip(object, tooltip)
gtkActionGetTooltip(object)
gtkActionSetStockId(object, stock.id)
gtkActionGetStockId(object)
gtkActionSetGicon(object, icon)
gtkActionGetGicon(object)
gtkActionSetIconName(object, icon.name)
gtkActionGetIconName(object)
gtkActionSetVisibleHorizontal(object, visible.horizontal)
gtkActionGetVisibleHorizontal(object)
gtkActionSetVisibleVertical(object, visible.vertical)
gtkActionGetVisibleVertical(object)
gtkActionSetIsImportant(object, is.important)
gtkActionGetIsImportant(object)
gtkAction(name = NULL, label = NULL, tooltip = NULL, stock.id = NULL)
1 2 3 4 | GObject
+----GtkAction
+----GtkToggleAction
+----GtkRecentAction
|
GtkAction implements
GtkBuildable
.
Actions represent operations that the user can be perform, along with some information how it should be presented in the interface. Each action provides methods to create icons, menu items and toolbar items representing itself.
As well as the callback that is called when the action gets activated, the following also gets associated with the action:
a name (not translated, for path lookup)
a label (translated, for display)
an accelerator
whether label indicates a stock id
a tooltip (optional, translated)
a toolbar label (optional, shorter than label)
The action will also have some state information:
visible (shown/hidden)
sensitive (enabled/disabled)
Apart from regular actions, there are GtkToggleAction
, which can be toggled between two states and GtkRadioAction
, of which only one in a group
can be in the "active" state. Other actions can be implemented as GtkAction
subclasses.
Each action can have one or more proxy menu item, toolbar button or other proxy widgets. Proxies mirror the state of the action (text label, tooltip, icon, visible, sensitive, etc), and should change when the action's state changes. When the proxy is activated, it should activate its action.
GtkAction
The GtkAction
struct contains only private members
and should not be accessed directly.
gtkAction
is the equivalent of gtkActionNew
.
activate(action, user.data)
The "activate" signal is emitted when the action is activated. Since 2.4
action
the GtkAction
user.data
user data set when the signal handler was connected.
action-group
[GtkActionGroup
: * : Read / Write]The GtkActionGroup this GtkAction is associated with, or NULL (for internal use).
always-show-image
[logical : Read / Write / Construct]If TRUE
, the action's menu item proxies will ignore the "gtk-menu-images"
setting and always show their image, if available.
Use this property if the menu item would be useless or hard to use without their image. Default value: FALSE Since 2.20
gicon
[GIcon
: * : Read / Write]The GIcon
displayed in the GtkAction
.
Note that the stock icon is preferred, if the "stock-id"
property holds the id of an existing stock icon.
This is an appearance property and thus only applies if
"use-action-appearance"
is TRUE
.
Since 2.16
hide-if-empty
[logical : Read / Write]When TRUE, empty menu proxies for this action are hidden. Default value: TRUE
icon-name
[character : * : Read / Write]The name of the icon from the icon theme.
Note that the stock icon is preferred, if the "stock-id"
property holds the id of an existing stock icon, and the GIcon
is
preferred if the "gicon"
property is set.
This is an appearance property and thus only applies if
"use-action-appearance"
is TRUE
.
Default value: NULL Since 2.10
is-important
[logical : Read / Write]Whether the action is considered important. When TRUE, toolitem proxies for this action show text in GTK_TOOLBAR_BOTH_HORIZ mode. Default value: FALSE
label
[character : * : Read / Write]The label used for menu items and buttons that activate
this action. If the label is NULL
, GTK+ uses the stock
label specified via the stock-id property.
This is an appearance property and thus only applies if
"use-action-appearance"
is TRUE
.
Default value: NULL
name
[character : * : Read / Write / Construct Only]A unique name for the action. Default value: NULL
sensitive
[logical : Read / Write]Whether the action is enabled. Default value: TRUE
short-label
[character : * : Read / Write]A shorter label that may be used on toolbar buttons.
This is an appearance property and thus only applies if
"use-action-appearance"
is TRUE
.
Default value: NULL
stock-id
[character : * : Read / Write]The stock icon displayed in widgets representing this action.
This is an appearance property and thus only applies if
"use-action-appearance"
is TRUE
.
Default value: NULL
tooltip
[character : * : Read / Write]A tooltip for this action. Default value: NULL
visible
[logical : Read / Write]Whether the action is visible. Default value: TRUE
visible-horizontal
[logical : Read / Write]Whether the toolbar item is visible when the toolbar is in a horizontal orientation. Default value: TRUE
visible-overflown
[logical : Read / Write]When TRUE
, toolitem proxies for this action are represented in the
toolbar overflow menu.
Default value: TRUE Since 2.6
visible-vertical
[logical : Read / Write]Whether the toolbar item is visible when the toolbar is in a vertical orientation. Default value: TRUE
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gtk2/stable/GtkAction.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.