A menu item with an icon
Class GtkImageMenuItem
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.
Methods | |
get_always_show_image | Returns whether the menu item will ignore the "gtk-menu-images" setting and always show the image, if available. |
get_image | Gets the widget that is currently set as the image of image_menu_item. |
get_use_stock | Checks whether the label set in the menuitem is used as a stock id to select the stock item for the item. |
new_from_stock | Creates a new GtkImageMenuItem containing the image and text from a stock item. |
new_with_label | Creates a new GtkImageMenuItem containing a label. |
new_with_mnemonic | Creates a new GtkImageMenuItem containing a label. |
set_always_show_image | If TRUE, the menu item will ignore the "gtk-menu-images" setting and always show the image, if available. |
set_image | Sets the image of image_menu_item to the given widget. |
set_use_stock | If TRUE, the label set in the menuitem is used as a stock id to select the stock item for the item. |
Returns whether the menu item will ignore the "gtk-menu-images" setting and always show the image, if available.
GtkImageMenuItem.get_always_show_image()
Return | TRUE if the menu item will always show the image |
Gets the widget that is currently set as the image of image_menu_item.
GtkImageMenuItem.get_image()
Return | the widget set as image of image_menu_item. |
Checks whether the label set in the menuitem is used as a stock id to select the stock item for the item.
GtkImageMenuItem.get_use_stock()
Return | TRUE if the label set in the menuitem is used as a stock id to select the stock item for the item |
Creates a new GtkImageMenuItem containing the image and text from a stock item.
GtkImageMenuItem.new_from_stock( stock_id, accel_group )
stock_id | the name of the stock item. |
accel_group | TODO the GtkAccelGroup to add the menu items accelerator to, or NULL. |
Return | a new GtkImageMenuItem. |
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 NULL 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.
Creates a new GtkImageMenuItem containing a label.
GtkImageMenuItem.new_with_label( label )
label | the text of the menu item. |
Return | a new GtkImageMenuItem. |
Creates a new GtkImageMenuItem containing a label.
GtkImageMenuItem.new_with_mnemonic( label )
label | the text of the menu item, with an underscore in front of the mnemonic character |
Return | a new GtkImageMenuItem. |
The label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.
If TRUE, the menu item will ignore the "gtk-menu-images" setting and always show the image, if available.
GtkImageMenuItem.set_always_show_image( always_show )
always_show | TRUE if the menuitem should always show the image |
Use this property if the menuitem would be useless or hard to use without the image.
Sets the image of image_menu_item to the given widget.
GtkImageMenuItem.set_image( image )
image | a widget to set as the image for the menu item (or nil). |
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.
GtkImageMenuItem.set_use_stock( use_stock )
use_stock | TRUE if the menuitem should use a stock item |