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 GtkMenuItem.
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".
See Also GtkBin, GtkMenuShell
Emits the "deselect" signal on the given item. Behaves exactly like gtk_item_deselect.
Retrieve the accelerator path that was previously set on menu_item. See gtk_menu_item_set_accel_path() for details. Since 2.14
Gets the application set action code
Sets text on the menu_item label Since 2.16
Returns whether the menu_item reserves space for the submenu indicator, regardless if it has a submenu or not.
Warning gtk_menu_item_get_right_justified has been deprecated since version 3.2 and should not be used in newly-written code. See gtk_menu_item_set_right_justified() 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 gtk_menu_item_set_submenu().
Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key. Since 2.16
Emits the "activate" signal on the given item
Emits the "select" signal on the given item. Behaves exactly like gtk_item_select.
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 gtk_accel_map_save() on this). To set up a default accelerator for this menu item, call gtk_accel_map_add_entry() with the same accel_path. See also gtk_accel_map_add_entry() on the specifics of accelerator paths, and gtk_menu_set_accel_path() for a more convenient variant of this function. This function is basically a convenience wrapper that handles calling gtk_widget_set_accel_path() with the appropriate accelerator group for the menu item. Note that you do need to set an accelerator on the parent menu with gtk_menu_set_accel_group() for this to work. Note that accel_path string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with g_intern_static_string().
Sets text on the menu_item label Since 2.16
Sets whether the menu_item should reserve space for the submenu indicator, regardless if it actually has a submenu or not. There should be little need for applications to call this functions.
Warning gtk_menu_item_set_right_justified has been deprecated since version 3.2 and should not be used in newly-written code. If you insist on using it, use gtk_widget_set_hexpand() and gtk_widget_set_halign(). 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. Since 2.16
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
the main Gtk struct as a void*
Gets the child of the GtkBin, 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.
the main Gtk struct as a void*
Warning gtk_activatable_do_set_related_action is deprecated and should not be used in newly-written code. 3.10 This is a utility function for GtkActivatable implementors. When implementing GtkActivatable you must call this when handling changes of the "related-action", and you must also use this to break references in GObject->dispose(). This function adds a reference to the currently set related action for you, it also makes sure the GtkActivatable->update() method is called when the related GtkAction properties change and registers to the action's proxy list. Note Be careful to call this before setting the local copy of the GtkAction property, since this function uses gtk_activatable_get_related_action() to retrieve the previous action Since 2.16
Warning gtk_activatable_get_related_action is deprecated and should not be used in newly-written code. 3.10 Gets the related GtkAction for activatable. Since 2.16
Warning gtk_activatable_get_use_action_appearance is deprecated and should not be used in newly-written code. 3.10 Gets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance. Since 2.16
Warning gtk_activatable_sync_action_properties is deprecated and should not be used in newly-written code. 3.10 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. Since 2.16
Warning gtk_activatable_set_related_action is deprecated and should not be used in newly-written code. 3.10 Sets the related action on the activatable object. Note GtkActivatable implementors need to handle the "related-action" property and call gtk_activatable_do_set_related_action() when it changes. Since 2.16
Warning gtk_activatable_set_use_action_appearance is deprecated and should not be used in newly-written code. 3.10 Sets whether this activatable should reset its layout and appearance when setting the related action or when the action changes appearance Note GtkActivatable implementors need to handle the "use-action-appearance" property and call gtk_activatable_sync_action_properties() to update activatable if needed. Since 2.16
The GtkMenuItem 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 GtkBin it can hold any valid child widget, although only a few are really useful.
By default, a GtkMenuItem sets a GtkAccelLabel 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.
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.