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.MenuToolButton.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(void* ptr, Flag!"Take" take)
this
this(gtk.widget.Widget iconWidget, string label)

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

Members

Functions

connectShowMenu
gulong connectShowMenu(T callback, Flag!"After" after)

Connect to ShowMenu signal.

getMenu
gtk.widget.Widget getMenu()

Gets the #GtkMenu associated with #GtkMenuToolButton.

self
MenuToolButton self()

Returns this, for use in with statements.

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.ToolItem.setTooltipText 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.ToolItem.setTooltipText for setting a tooltip on the whole #GtkMenuToolButton.

setMenu
void setMenu(gtk.widget.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.

Properties

_gType
GType _gType [@property getter]
menu
gtk.menu.Menu menu [@property getter]
menu
gtk.menu.Menu menu [@property setter]

Static functions

_getGType
GType _getGType()
builder
MenuToolButtonGidBuilder builder()

Get builder for gtk.menu_tool_button.MenuToolButton

newFromStock
gtk.menu_tool_button.MenuToolButton newFromStock(string stockId)

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

Inherited Members

From ToolButton

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
ToolButton self()

Returns this, for use in with statements.

builder
ToolButtonGidBuilder builder()

Get builder for gtk.tool_button.ToolButton

iconName
string iconName [@property getter]

Get iconName property.

iconName
string iconName [@property setter]

Set iconName property.

iconWidget
gtk.widget.Widget iconWidget [@property getter]
iconWidget
gtk.widget.Widget iconWidget [@property setter]
label
string label [@property getter]
label
string label [@property setter]
labelWidget
gtk.widget.Widget labelWidget [@property getter]
labelWidget
gtk.widget.Widget labelWidget [@property setter]
stockId
string stockId [@property getter]
stockId
string stockId [@property setter]
useUnderline
bool useUnderline [@property getter]
useUnderline
bool useUnderline [@property setter]
newFromStock
gtk.tool_button.ToolButton newFromStock(string stockId)

Creates a new #GtkToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like #GTK_STOCK_OK and #GTK_STOCK_APPLY.

getIconName
string getIconName()

Returns the name of the themed icon for the tool button, see gtk.tool_button.ToolButton.setIconName.

getIconWidget
gtk.widget.Widget getIconWidget()

Return the widget used as icon widget on button. See gtk.tool_button.ToolButton.setIconWidget.

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
gtk.widget.Widget getLabelWidget()

Returns the widget used as label on button. See gtk.tool_button.ToolButton.setLabelWidget.

getStockId
string getStockId()

Returns the name of the stock item. See gtk.tool_button.ToolButton.setStockId. 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.ToolButton.setUseUnderline.

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 #GtkToolButton:icon-name property only has an effect if not overridden by non-null #GtkToolButton:label-widget, #GtkToolButton:icon-widget and #GtkToolButton:stock-id properties.

setIconWidget
void setIconWidget(gtk.widget.Widget iconWidget)

Sets icon as the widget used as icon on button. If icon_widget is null the icon is determined by the #GtkToolButton:stock-id property. If the #GtkToolButton: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 #GtkToolButton:label property only has an effect if not overridden by a non-null #GtkToolButton:label-widget property. If both the #GtkToolButton:label-widget and #GtkToolButton:label properties are null, the label is determined by the #GtkToolButton:stock-id property. If the #GtkToolButton:stock-id property is also null, button will not have a label.

setLabelWidget
void setLabelWidget(gtk.widget.Widget labelWidget)

Sets label_widget as the widget that will be used as the label for button. If label_widget is null the #GtkToolButton:label property is used as label. If #GtkToolButton:label is also null, the label in the stock item determined by the #GtkToolButton:stock-id property is used as label. If #GtkToolButton: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.ToolButton.newFromStock. The stock_id property only has an effect if not overridden by non-null #GtkToolButton:label-widget and #GtkToolButton: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”.

connectClicked
gulong connectClicked(T callback, Flag!"After" after)

Connect to Clicked signal.