ImageMenuItem

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.

Constructors

this
this(GtkImageMenuItem* gtkImageMenuItem, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string label, bool mnemonic)

Creates a new GtkImageMenuItem containing a label. If mnemonic it true the label will be created using gtk_label_new_with_mnemonic(), so underscores in label indicate the mnemonic for the menu item.

this
this(StockID stockID, AccelGroup accelGroup)

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.

this
this()

Creates a new #GtkImageMenuItem with an empty label.

Members

Functions

getAlwaysShowImage
bool getAlwaysShowImage()

Returns whether the menu item will ignore the #GtkSettings:gtk-menu-images setting and always show the image, if available.

getImage
Widget getImage()

Gets the widget that is currently set as the image of @image_menu_item. See gtk_image_menu_item_set_image().

getImageMenuItemStruct
GtkImageMenuItem* getImageMenuItemStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getUseStock
bool getUseStock()

Checks whether the label set in the menuitem is used as a stock id to select the stock item for the item.

setAccelGroup
void setAccelGroup(AccelGroup accelGroup)

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 gtk_image_menu_item_set_use_stock() and gtk_menu_item_set_label() with a valid stock item first).

setAlwaysShowImage
void setAlwaysShowImage(bool alwaysShow)

If %TRUE, the menu item will ignore the #GtkSettings:gtk-menu-images setting and always show the image, if available.

setImage
void setImage(Widget 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.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
setUseStock
void setUseStock(bool useStock)

If %TRUE, the label set in the menuitem is used as a stock id to select the stock item for the item.

Static functions

getType
GType getType()

Variables

gtkImageMenuItem
GtkImageMenuItem* gtkImageMenuItem;

the main Gtk struct

Inherited Members

From MenuItem

gtkMenuItem
GtkMenuItem* gtkMenuItem;

the main Gtk struct

getMenuItemStruct
GtkMenuItem* getMenuItemStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
__anonymous
mixin ActionableT!(GtkMenuItem)
Undocumented in source.
__anonymous
mixin ActivatableT!(GtkMenuItem)
Undocumented in source.
getActionName
string getActionName()

Gets the application set action code

getType
GType getType()
itemActivate
void itemActivate()

Emits the #GtkMenuItem::activate signal on the given item

deselect
void deselect()

Emits the #GtkMenuItem::deselect signal on the given item.

getAccelPath
string getAccelPath()

Retrieve the accelerator path that was previously set on @menu_item.

getLabel
string getLabel()

Sets @text on the @menu_item label

getReserveIndicator
bool getReserveIndicator()

Returns whether the @menu_item reserves space for the submenu indicator, regardless if it has a submenu or not.

getRightJustified
bool getRightJustified()

Gets whether the menu item appears justified at the right side of the menu bar.

getSubmenu
Widget getSubmenu()

Gets the submenu underneath this menu item, if any. See gtk_menu_item_set_submenu().

getUseUnderline
bool getUseUnderline()

Checks if an underline in the text indicates the next character should be used for the mnemonic accelerator key.

select
void select()

Emits the #GtkMenuItem::select signal on the given item.

setAccelPath
void setAccelPath(string accelPath)

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 gtk_accel_map_save() on this). To set up a default accelerator for this menu item, call gtk_accel_map_add_entry() with the same @accel_path. See also gtk_accel_map_add_entry() on the specifics of accelerator paths, and gtk_menu_set_accel_path() for a more convenient variant of this function.

setLabel
void setLabel(string label)

Sets @text on the @menu_item label

setReserveIndicator
void setReserveIndicator(bool reserve)

Sets whether the @menu_item should reserve space for the submenu indicator, regardless if it actually has a submenu or not.

setRightJustified
void setRightJustified(bool rightJustified)

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.)

setSubmenu
void setSubmenu(Menu submenu)

Sets or replaces the menu item’s submenu, or removes it when a %NULL submenu is passed.

setUseUnderline
void setUseUnderline(bool setting)

If true, an underline in the text indicates the next character should be used for the mnemonic accelerator key.

toggleSizeAllocate
void toggleSizeAllocate(int allocation)

Emits the #GtkMenuItem::toggle-size-allocate signal on the given item.

toggleSizeRequest
void toggleSizeRequest(int requisition)

Emits the #GtkMenuItem::toggle-size-request signal on the given item.

connectedSignals
int[string] connectedSignals;
Undocumented in source.
onActivateListeners
void delegate(MenuItem)[] onActivateListeners;
Undocumented in source.
addOnActivate
void addOnActivate(void delegate(MenuItem) dlg, ConnectFlags connectFlags)

Emitted when the item is activated.

callBackActivate
void callBackActivate(GtkMenuItem* menuitemStruct, MenuItem _menuitem)
Undocumented in source. Be warned that the author may not have intended to support it.
onActivateItemListeners
void delegate(MenuItem)[] onActivateItemListeners;
Undocumented in source.
addOnActivateItem
void addOnActivateItem(void delegate(MenuItem) dlg, ConnectFlags connectFlags)

Emitted when the item is activated, but also if the menu item has a submenu. For normal applications, the relevant signal is #GtkMenuItem::activate.

callBackActivateItem
void callBackActivateItem(GtkMenuItem* menuitemStruct, MenuItem _menuitem)
Undocumented in source. Be warned that the author may not have intended to support it.
onDeselectListeners
void delegate(MenuItem)[] onDeselectListeners;
Undocumented in source.
addOnDeselect
void addOnDeselect(void delegate(MenuItem) dlg, ConnectFlags connectFlags)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackDeselect
void callBackDeselect(GtkMenuItem* menuitemStruct, MenuItem _menuitem)
Undocumented in source. Be warned that the author may not have intended to support it.
onSelectListeners
void delegate(MenuItem)[] onSelectListeners;
Undocumented in source.
addOnSelect
void addOnSelect(void delegate(MenuItem) dlg, ConnectFlags connectFlags)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackSelect
void callBackSelect(GtkMenuItem* menuitemStruct, MenuItem _menuitem)
Undocumented in source. Be warned that the author may not have intended to support it.
onToggleSizeAllocateListeners
void delegate(int, MenuItem)[] onToggleSizeAllocateListeners;
Undocumented in source.
addOnToggleSizeAllocate
void addOnToggleSizeAllocate(void delegate(int, MenuItem) dlg, ConnectFlags connectFlags)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackToggleSizeAllocate
void callBackToggleSizeAllocate(GtkMenuItem* menuitemStruct, int object, MenuItem _menuitem)
Undocumented in source. Be warned that the author may not have intended to support it.
onToggleSizeRequestListeners
void delegate(void*, MenuItem)[] onToggleSizeRequestListeners;
Undocumented in source.
addOnToggleSizeRequest
void addOnToggleSizeRequest(void delegate(void*, MenuItem) dlg, ConnectFlags connectFlags)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackToggleSizeRequest
void callBackToggleSizeRequest(GtkMenuItem* menuitemStruct, void* object, MenuItem _menuitem)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta