A GtkToolItem containing a button with an additional dropdown menu
Class GtkMenuToolButton( icon_widget, label )
icon_widget | a widget that will be used as icon widget, or NULL. |
label | a string that will be used as label, or NULL. |
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.
Methods | |
get_menu | Gets the GtkMenu associated with GtkMenuToolButton. |
new_from_stock | Creates a new GtkMenuToolButton. |
set_arrow_tooltip_markup | Sets the tooltip markup text to be used as tooltip for the arrow button which pops up the menu. |
set_arrow_tooltip_text | Sets the tooltip text to be used as tooltip for the arrow button which pops up the menu. |
set_menu | Sets the GtkMenu that is popped up when the user clicks on the arrow. |
signal_show_menu | The show-menu signal is emitted before the menu is shown. |
Gets the GtkMenu associated with GtkMenuToolButton.
GtkMenuToolButton.get_menu()
Return | the GtkMenu associated with GtkMenuToolButton |
Creates a new GtkMenuToolButton.
GtkMenuToolButton.new_from_stock( stock_id )
stock_id | the name of a stock item |
Return | the new GtkMenuToolButton |
The new GtkMenuToolButton will contain an icon and label from the stock item indicated by stock_id.
Sets the tooltip markup text to be used as tooltip for the arrow button which pops up the menu.
GtkMenuToolButton.set_arrow_tooltip_markup( markup )
markup | markup text to be used as tooltip text for button's arrow button |
See gtk_tool_item_set_tooltip() for setting a tooltip on the whole GtkMenuToolButton.
Sets the tooltip text to be used as tooltip for the arrow button which pops up the menu.
GtkMenuToolButton.set_arrow_tooltip_text( text )
text | text to be used as tooltip text for button's arrow button |
See gtk_tool_item_set_tooltip() for setting a tooltip on the whole GtkMenuToolButton.
Sets the GtkMenu that is popped up when the user clicks on the arrow.
GtkMenuToolButton.set_menu( menu )
menu | the GtkMenu associated with GtkMenuToolButton, or nil. |
If menu is NULL, the arrow button becomes insensitive.
The show-menu signal is emitted before the menu is shown.
GtkMenuToolButton.signal_show_menu()
It can be used to populate the menu on demand, using gtk_menu_tool_button_get_menu().
Note that even if you populate the menu dynamically in this way, you must set an empty menu on the GtkMenuToolButton beforehand, since the arrow is made insensitive if the menu is not set.