Next: , Previous: GtkMenuShell, Up: Top

60 GtkImageMenuItem

A menu item with an icon

60.1 Overview

A GtkImageMenuItem is a menu item which has an icon next to the text label.

Note that the user can disable display of menu icons, so make sure to still fill in the text label.

60.2 Usage

— Class: <gtk-image-menu-item>

Derives from <gtk-menu-item>.

This class defines the following slots:

Child widget to appear next to the menu text
— Function: gtk-image-menu-item-set-image (self <gtk-image-menu-item>) (image <gtk-widget>)
— Method: set-image

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.

a <gtk-image-menu-item>.
a widget to set as the image for the menu item.
— Function: gtk-image-menu-item-get-image (self <gtk-image-menu-item>) ⇒  (ret <gtk-widget>)
— Method: get-image

Gets the widget that is currently set as the image of image-menu-item. See gtk-image-menu-item-set-image.

a <gtk-image-menu-item>.
the widget set as image of image-menu-item.
— Function: gtk-image-menu-item-new ⇒  (ret <gtk-widget>)

Creates a new <gtk-image-menu-item> with an empty label.

a new <gtk-image-menu-item>.
— Function: gtk-image-menu-item-new-from-stock (stock_id mchars) (accel_group <gtk-accel-group>) ⇒  (ret <gtk-widget>)

Creates a new <gtk-image-menu-item> containing the image and text from a stock item. Some stock ids have preprocessor macros like <gtk-stock-ok> and <gtk-stock-apply>.

If you want this menu item to have changeable accelerators, then pass in ‘#f’ for accel_group. Next call gtk-menu-item-set-accel-path with an appropriate path for the menu item, use gtk-stock-lookup to look up the standard accelerator for the stock item, and if one is found, call gtk-accel-map-add-entry to register it.

the name of the stock item.
the <gtk-accel-group> to add the menu items accelerator to, or ‘#f’.
a new <gtk-image-menu-item>.
— Function: gtk-image-menu-item-new-with-label (label mchars) ⇒  (ret <gtk-widget>)

Creates a new <gtk-image-menu-item> containing a label.

the text of the menu item.
a new <gtk-image-menu-item>.