| GTK+ Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | Next Page >>> | 
| #include <gtk/gtk.h> struct GtkImageMenuItem; void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item, GtkWidget *image); GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item); GtkWidget* gtk_image_menu_item_new (void); GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id, GtkAccelGroup *accel_group); GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label); GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label); | 
| GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkItem +----GtkMenuItem +----GtkImageMenuItem | 
| void gtk_image_menu_item_set_image (GtkImageMenuItem *image_menu_item, GtkWidget *image); | 
Sets the image of image_menu_item to the given widget.
| image_menu_item : | |
| image : | a widget to set as the image for the menu item. | 
| GtkWidget* gtk_image_menu_item_get_image (GtkImageMenuItem *image_menu_item); | 
Gets the widget that is currently set as the image of image_menu_item. See gtk_image_menu_item_set_image().
| image_menu_item : | |
| Returns : | the widget set as image of image_menu_item. | 
| GtkWidget* gtk_image_menu_item_new (void); | 
Creates a new GtkImageMenuItem with an empty label.
| Returns : | a new GtkImageMenuItem. | 
| GtkWidget* gtk_image_menu_item_new_from_stock (const gchar *stock_id, GtkAccelGroup *accel_group); | 
Creates a new GtkImageMenuItem 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 NULL for accel_group call gtk_menu_item_set_accel_path() with an appropriate path for the menu item, then use gtk_stock_lookup() too look up the standard accelerator for the stock item and if one is found, call gtk_accel_map_add_entry() to register it.
| stock_id : | the name of the stock item. | 
| accel_group : | the GtkAccelGroup to add the menu items accelerator to, or NULL. | 
| Returns : | a new GtkImageMenuItem. | 
| GtkWidget* gtk_image_menu_item_new_with_label (const gchar *label); | 
Creates a new GtkImageMenuItem containing a label.
| label : | the text of the menu item. | 
| Returns : | a new GtkImageMenuItem. | 
| GtkWidget* gtk_image_menu_item_new_with_mnemonic (const gchar *label); | 
Creates a new GtkImageMenuItem containing a label. The label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.
| label : | the text of the menu item, with an underscore in front of the mnemonic character | 
| Returns : | a new GtkImageMenuItem |