MenuToolButton

A #GtkMenuToolButton is a #GtkToolItem that contains a button and a small additional button with an arrow. When clicked, the arrow button pops up a dropdown menu.

Use gtk_menu_tool_button_new() to create a new #GtkMenuToolButton.

GtkMenuToolButton as GtkBuildable

The GtkMenuToolButton implementation of the GtkBuildable interface supports adding a menu by specifying “menu” as the “type” attribute of a <child> element.

An example for a UI definition fragment with menus: |[ <object class="GtkMenuToolButton"> <child type="menu"> <object class="GtkMenu"/> </child> </object> ]|

Constructors

this
this(GtkMenuToolButton* gtkMenuToolButton, bool ownedRef)

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

this
this(StockID stockId)

Creates a new GtkMenuToolButton. The new GtkMenuToolButton will contain an icon and label from the stock item indicated by stockID.

this
this(Widget iconWidget, string label)

Creates a new #GtkMenuToolButton using @icon_widget as icon and @label as label.

this
this(string stockId)

Creates a new #GtkMenuToolButton. The new #GtkMenuToolButton will contain an icon and label from the stock item indicated by @stock_id.

Members

Functions

addOnShowMenu
void addOnShowMenu(void delegate(MenuToolButton) dlg, ConnectFlags connectFlags)

The ::show-menu signal is emitted before the menu is shown.

getMenu
Menu getMenu()

Gets the GtkMenu associated with GtkMenuToolButton.

getMenuToolButtonStruct
GtkMenuToolButton* getMenuToolButtonStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setArrowTooltipMarkup
void setArrowTooltipMarkup(string markup)

Sets the tooltip markup text to be used as tooltip for the arrow button which pops up the menu. See gtk_tool_item_set_tooltip_text() for setting a tooltip on the whole #GtkMenuToolButton.

setArrowTooltipText
void setArrowTooltipText(string text)

Sets the tooltip text to be used as tooltip for the arrow button which pops up the menu. See gtk_tool_item_set_tooltip_text() for setting a tooltip on the whole #GtkMenuToolButton.

setMenu
void setMenu(Widget menu)

Sets the #GtkMenu that is popped up when the user clicks on the arrow. If @menu is NULL, the arrow button becomes insensitive.

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

Static functions

callBackShowMenu
void callBackShowMenu(GtkMenuToolButton* menutoolbuttonStruct, MenuToolButton _menutoolbutton)
Undocumented in source. Be warned that the author may not have intended to support it.
getType
GType getType()

Variables

connectedSignals
int[string] connectedSignals;
Undocumented in source.
gtkMenuToolButton
GtkMenuToolButton* gtkMenuToolButton;

the main Gtk struct

onShowMenuListeners
void delegate(MenuToolButton)[] onShowMenuListeners;
Undocumented in source.

Inherited Members

From ToolButton

gtkToolButton
GtkToolButton* gtkToolButton;

the main Gtk struct

getToolButtonStruct
GtkToolButton* getToolButtonStruct()

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!(GtkToolButton)
Undocumented in source.
getType
GType getType()
getIconName
string getIconName()

Returns the name of the themed icon for the tool button, see gtk_tool_button_set_icon_name().

getIconWidget
Widget getIconWidget()

Return the widget used as icon widget on @button. See gtk_tool_button_set_icon_widget().

getLabel
string getLabel()

Returns the label used by the tool button, or %NULL if the tool button doesn’t have a label. or uses a the label from a stock item. The returned string is owned by GTK+, and must not be modified or freed.

getLabelWidget
Widget getLabelWidget()

Returns the widget used as label on @button. See gtk_tool_button_set_label_widget().

getStockId
string getStockId()

Returns the name of the stock item. See gtk_tool_button_set_stock_id(). The returned string is owned by GTK+ and must not be freed or modifed.

getUseUnderline
bool getUseUnderline()

Returns whether underscores in the label property are used as mnemonics on menu items on the overflow menu. See gtk_tool_button_set_use_underline().

setIconName
void setIconName(string iconName)

Sets the icon for the tool button from a named themed icon. See the docs for #GtkIconTheme for more details. The “icon_name” property only has an effect if not overridden by non-%NULL “label”, “icon_widget” and “stock_id” properties.

setIconWidget
void setIconWidget(Widget iconWidget)

Sets @icon as the widget used as icon on @button. If @icon_widget is %NULL the icon is determined by the “stock_id” property. If the “stock_id” property is also %NULL, @button will not have an icon.

setLabel
void setLabel(string label)

Sets @label as the label used for the tool button. The “label” property only has an effect if not overridden by a non-%NULL “label_widget” property. If both the “label_widget” and “label” properties are %NULL, the label is determined by the “stock_id” property. If the “stock_id” property is also %NULL, @button will not have a label.

setLabelWidget
void setLabelWidget(Widget labelWidget)

Sets @label_widget as the widget that will be used as the label for @button. If @label_widget is %NULL the “label” property is used as label. If “label” is also %NULL, the label in the stock item determined by the “stock_id” property is used as label. If “stock_id” is also %NULL, @button does not have a label.

setStockId
void setStockId(string stockId)

Sets the name of the stock item. See gtk_tool_button_new_from_stock(). The stock_id property only has an effect if not overridden by non-%NULL “label” and “icon_widget” properties.

setUseUnderline
void setUseUnderline(bool useUnderline)

If set, an underline in the label property indicates that the next character should be used for the mnemonic accelerator key in the overflow menu. For example, if the label property is “_Open” and @use_underline is %TRUE, the label on the tool button will be “Open” and the item on the overflow menu will have an underlined “O”.

connectedSignals
int[string] connectedSignals;
Undocumented in source.
onClickedListeners
void delegate(ToolButton)[] onClickedListeners;
Undocumented in source.
addOnClicked
void addOnClicked(void delegate(ToolButton) dlg, ConnectFlags connectFlags)

This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.

callBackClicked
void callBackClicked(GtkToolButton* toolbuttonStruct, ToolButton _toolbutton)
Undocumented in source. Be warned that the author may not have intended to support it.

Meta