Description Methods and Functions Hierarchy Interfaces Detailed Description GtkMenuItem as GtkBuildable Structures Convenient Construction Signals Properties Style Properties Author(s) References
The widget used for item in menus
gtkMenuItemNew(show = TRUE)
gtkMenuItemNewWithLabel(label, show = TRUE)
gtkMenuItemNewWithMnemonic(label, show = TRUE)
gtkMenuItemSetRightJustified(object, right.justified)
gtkMenuItemGetRightJustified(object)
gtkMenuItemGetLabel(object)
gtkMenuItemSetLabel(object, label)
gtkMenuItemGetUseUnderline(object)
gtkMenuItemSetUseUnderline(object, setting)
gtkMenuItemSetSubmenu(object, submenu)
gtkMenuItemGetSubmenu(object)
gtkMenuItemRemoveSubmenu(object)
gtkMenuItemSetAccelPath(object, accel.path)
gtkMenuItemGetAccelPath(object)
gtkMenuItemSelect(object)
gtkMenuItemDeselect(object)
gtkMenuItemActivate(object)
gtkMenuItemToggleSizeRequest(object, requisition)
gtkMenuItemToggleSizeAllocate(object, allocation)
gtkMenuItem(label, show = TRUE)
1 2 3 4 5 6 7 8 9 10 11 12 | GObject
+----GInitiallyUnowned
+----GtkObject
+----GtkWidget
+----GtkContainer
+----GtkBin
+----GtkItem
+----GtkMenuItem
+----GtkCheckMenuItem
+----GtkImageMenuItem
+----GtkSeparatorMenuItem
+----GtkTearoffMenuItem
|
GtkMenuItem implements
AtkImplementorIface, GtkBuildable
and GtkActivatable
.
The GtkMenuItem
widget and the derived widgets are the only valid
childs for menus. Their function is to correctly handle highlighting,
alignment, events and submenus.
As it derives from GtkBin
it can hold any valid child widget, altough
only a few are really useful.
The GtkMenuItem implementation of the GtkBuildable interface supports adding a submenu by specifying "submenu" as the "type" attribute of a <child> element.
A UI definition fragment with submenus
1 2 3 4 5 |
GtkMenuItem
undocumented
gtkMenuItem
is the result of collapsing the constructors of GtkMenuItem
(gtkMenuItemNew
, gtkMenuItemNewWithLabel
, gtkMenuItemNewWithMnemonic
) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.
activate(menuitem, user.data)
Emitted when the item is activated.
menuitem
the object which received the signal.
user.data
user data set when the signal handler was connected.
activate-item(menuitem, user.data)
Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is "activate".
menuitem
the object which received the signal.
user.data
user data set when the signal handler was connected.
toggle-size-allocate(menuitem, user.data)
undocumented
menuitem
the object which received the signal.
user.data
user data set when the signal handler was connected.
toggle-size-request(menuitem, user.data)
undocumented
menuitem
the object which received the signal.
user.data
user data set when the signal handler was connected.
accel-path
[character : * : Read / Write]Sets the accelerator path of the menu item, through which runtime changes of the menu item's accelerator caused by the user can be identified and saved to persistant storage. Default value: NULL Since 2.14
label
[character : * : Read / Write]The text for the child label. Default value: "" Since 2.16
right-justified
[logical : Read / Write]Sets whether the menu item appears justified at the right side of a menu bar. Default value: FALSE Since 2.14
submenu
[GtkMenu
: * : Read / Write]The submenu attached to the menu item, or NULL if it has none. Since 2.12
use-underline
[logical : Read / Write]TRUE
if underlines in the text indicate mnemonics
Default value: FALSE Since 2.16
arrow-scaling
[numeric : Read]Amount of space used up by arrow, relative to the menu item's font size. Allowed values: [0,2] Default value: 0.8
arrow-spacing
[integer : Read]Space between label and arrow. Allowed values: >= 0 Default value: 10
horizontal-padding
[integer : Read]Padding to left and right of the menu item. Allowed values: >= 0 Default value: 3
selected-shadow-type
[GtkShadowType
: Read]Shadow type when item is selected. Default value: GTK_SHADOW_NONE
toggle-spacing
[integer : Read]Space between icon and label. Allowed values: >= 0 Default value: 5
width-chars
[integer : Read]The minimum desired width of the menu item in characters. Allowed values: >= 0 Default value: 12 Since 2.14
Derived by RGtkGen from GTK+ documentation
https://developer.gnome.org/gtk2/stable/GtkMenuItem.html
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.