Sets our main struct and passes it to the parent class.
Creates a new menu item with a label and a listener and a action. used for backward compatibily with DUI.
Creates a new Item associated with a "activate" delegate and with a action code and optionally accelGroup
Creates a new Item associated with a "activate" delegate
Creates a new GtkMenuItem whose child is a GtkLabel.
Creates a new gtk.MenuItem
Emitted when the item is activated.
Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is activate.
Emits the deselect signal on the given item.
Retrieve the accelerator path that was previously set on menu_item.
Gets the application set action code
Sets text on the menu_item label
Get the main Gtk struct
Returns whether the menu_item reserves space for the submenu indicator, regardless if it has a submenu or not.
Gets whether the menu item appears justified at the right side of the menu bar.
the main Gtk struct as a void*
Gets the submenu underneath this menu item, if any. See Menu.itemSetSubmenu.
Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.
Emits the activate signal on the given item
Emits the select signal on the given item.
Set the accelerator path on menu_item, through which runtime changes of the menu item’s accelerator caused by the user can be identified and saved to persistent storage (see AccelMap.save on this). To set up a default accelerator for this menu item, call AccelMap.addEntry with the same accel_path. See also AccelMap.addEntry on the specifics of accelerator paths, and Menu.setAccelPath for a more convenient variant of this function.
Sets text on the menu_item label
Sets whether the menu_item should reserve space for the submenu indicator, regardless if it actually has a submenu or not.
Sets whether the menu item appears justified at the right side of a menu bar. This was traditionally done for “Help” menu items, but is now considered a bad idea. (If the widget layout is reversed for a right-to-left language like Hebrew or Arabic, right-justified-menu-items appear at the left.)
Sets or replaces the menu item’s submenu, or removes it when a NULL submenu is passed.
If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
Emits the toggle-size-allocate signal on the given item.
Emits the toggle-size-request signal on the given item.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Gets the child of the gtk.Bin, or NULL if the bin contains no child widget. The returned widget does not have a reference added, so you do not need to unref it.
Get the main Gtk struct
the main Gtk struct as a void*
Gets the action name for actionable.
Gets the current target value of actionable.
Specifies the name of the action with which this widget should be associated. If action_name is NULL then the widget will be unassociated from any previous action.
Sets the target value of an actionable widget.
Sets the action-name and associated string target value of an actionable widget.
Get the main Gtk struct
the main Gtk struct as a void*
This is a utility function for GtkActivatable implementors.
Gets the related gtk.Action for activatable.
Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance.
Sets the related action on the activatable object.
Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance
This is called to update the activatable completely, this is called internally when the related-action property is set or unset and by the implementing class when use-action-appearance changes.
The gtk.MenuItem widget and the derived widgets are the only valid children for menus. Their function is to correctly handle highlighting, alignment, events and submenus.
As a GtkMenuItem derives from gtk.Bin it can hold any valid child widget, although only a few are really useful.
By default, a GtkMenuItem sets a gtk.AccelLabel as its child. GtkMenuItem has direct functions to set the label and its mnemonic. For more advanced label settings, you can fetch the child widget from the GtkBin.
An example for setting markup and accelerator on a MenuItem:
GtkMenuItem as GtkBuildable
The GtkMenuItem implementation of the GtkBuildable interface supports adding a submenu by specifying “submenu” as the “type” attribute of a <child> element.
An example of UI definition fragment with submenus: |[ <object class="GtkMenuItem"> <child type="submenu"> <object class="GtkMenu"/> </child> </object>
GtkMenuItem has a single CSS node with name menuitem. If the menuitem has a submenu, it gets another CSS node with name arrow, which has the .left or .right style class.