gtk.ImageMenuItem — a menuitem that displays an image with an accel label
class gtk.ImageMenuItem(gtk.MenuItem): |
+--gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Item +-- gtk.MenuItem +-- gtk.ImageMenuItem
|
The gtk.ImageMenuItem
widget is a subclass of gtk.MenuItem that
contains an image widget and a gtk.AccelLabel
though a gtk.ImageMenuItem
can be created that has no image and an empty label.
gtk.ImageMenuItem(stock_id=None, accel_group=None)
| the stock icon ID or None if
no image is needed |
| the accel group to add the accel label mnemonic to |
Returns : | a new gtk.ImageMenuItem
widget |
Creates a new gtk.ImageMenuItem
with a stock label and image specified by stock_id.
If stock_id is not a stock item then the image will
be the "broken image" and the label text will be the string in
stock_id. The label text will be parsed for
underscore characters to indicate the mnemonic character for the
accelerator.
If stock_id specifies a stock item and
accel_group specifies a gtk.AccelGroup
the accelerator is added to accel_group.
def set_image(image)
| a widget to set as the image for the menu item. |
The set_image() method sets the image
of the image menu item to the widget specified in
image.
def get_image()Returns : | the image in the image menu item |
The get_image() method gets the widget
that is currently set as the image of image menu item. See set_image().
def set_always_show_image(always_show)
| True if the menuitem should always show the image, False otherwise. |
This method is available in PyGTK 2.16 and above.
The set_always_show_image() method sets whether
the menu item will ignore the "gtk-menu-images" setting and always show the image,
if available.
def get_always_show_image()Returns : | True if the menuitem will always show the image, False otherwise.. |
This method is available in PyGTK 2.16 and above.
The get_always_show_image() method returns whether
the menu item will ignore the "gtk-menu-images" setting and always show the image,
if available.
def set_use_stock(use_stock)
| True if the menuitem should use a stock item, False otherwise. |
This method is available in PyGTK 2.16 and above.
The set_use_stock() method sets whether
the label set in the menuitem is used as a stock id to select the stock
item for the item.
def get_use_stock()Returns : | True if the menuitem will use a stock item, False otherwise. |
This method is available in PyGTK 2.16 and above.
The get_use_stock() method gets whether
the label set in the menuitem is used as a stock id to select the stock item for the item.
def set_accel_group(accel_group)
| The gtk.AccelGroup. |
This method is available in PyGTK 2.16 and above.
The set_accel_group() method 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
get_accel_width
If you want this menu item to have changeable accelerators then you shouldnt need this (see gtk_image_menu_item_new_from_stock()).