Sets our main struct and passes it to the parent class.
Creates a new GtkImageMenuItem containing a label. If mnemonic it true the label will be created using Label.newWithMnemonic, so underscores in label indicate the mnemonic for the menu item.
Creates a new GtkImageMenuItem containing the image and text from a stock item. If you want this menu item to have changeable accelerators, then pass in null for accelGroup. Next call setAccelPath() with an appropriate path for the menu item, use gtk.StockItem.StockItem.lookup() to look up the standard accelerator for the stock item, and if one is found, call gtk.AccelMap.AccelMap.addEntry() to register it.
Creates a new gtk.ImageMenuItem with an empty label.
Returns whether the menu item will ignore the gtk-menu-images setting and always show the image, if available.
Gets the widget that is currently set as the image of image_menu_item. See Image.menuItemSetImage.
Get the main Gtk struct
the main Gtk struct as a void*
Checks whether the label set in the menuitem is used as a stock id to select the stock item for the item.
Specifies an accel_group to add the menu items accelerator to (this only applies to stock items so a stock item must already be set, make sure to call Image.menuItemSetUseStock and Menu.itemSetLabel with a valid stock item first).
If TRUE, the menu item will ignore the gtk-menu-images setting and always show the image, if available.
Sets the image of image_menu_item to the given widget. Note that it depends on the show-menu-images setting whether the image will be displayed or not.
If TRUE, the label set in the menuitem is used as a stock id to select the stock item for the item.
the main Gtk struct
the main Gtk struct
Get the main Gtk struct
the main Gtk struct as a void*
Gets the application set action code
Emits the activate signal on the given item
Emits the deselect signal on the given item.
Retrieve the accelerator path that was previously set on menu_item.
Sets text on the menu_item label
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.
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 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.
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.
A GtkImageMenuItem is a menu item which has an icon next to the text label.
This is functionally equivalent to:
Note that the user may disable display of menu icons using the gtk-menu-images setting, so make sure to still fill in the text label. If you want to ensure that your menu items show an icon you are strongly encouraged to use a gtk.MenuItem with a gtk.Image instead.
gtk.ImageMenuItem has been deprecated since GTK+ 3.10. If you want to display an icon in a menu item, you should use gtk.MenuItem and pack a gtk.Box with a gtk.Image and a gtk.Label instead. You should also consider using gtk.Builder and the XML gtk.Menu description for creating menus, by following the [GMenu guide]https://developer.gnome.org/GMenu/. You should consider using icons in menu items only sparingly, and for "objects" (or "nouns") elements only, like bookmarks, files, and links; "actions" (or "verbs") should not have icons.
Furthermore, if you would like to display keyboard accelerator, you must pack the accel label into the box using Box.packEnd and align the label, otherwise the accelerator will not display correctly. The following code snippet adds a keyboard accelerator to the menu item, with a key binding of Ctrl+M: