Gtk.MenuToolButton¶
| Subclasses: | None | 
|---|
Methods¶
| class | new(icon_widget, label) | 
| class | new_from_stock(stock_id) | 
| get_menu() | |
| set_arrow_tooltip_markup(markup) | |
| set_arrow_tooltip_text(text) | |
| set_menu(menu) | 
Virtual Methods¶
| Inherited: | Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Activatable (2), Gtk.Actionable (4) | 
|---|
| do_show_menu() | 
Properties¶
| Inherited: | Gtk.ToolButton (6), Gtk.ToolItem (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Activatable (2), Gtk.Actionable (2) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| menu | Gtk.Menu | r/w | The dropdown menu | 
Style Properties¶
| Inherited: | Gtk.ToolButton (1), Gtk.Widget (17) | 
|---|
Signals¶
| Inherited: | Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| show-menu | The ::show-menusignal is emitted before the menu is shown. | 
Fields¶
| Inherited: | Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| parent | Gtk.ToolButton | r | 
Class Details¶
- 
class Gtk.MenuToolButton(*args, **kwargs)¶
- Bases: - Gtk.ToolButton- Abstract: - No - Structure: - Gtk.MenuToolButtonClass- A - Gtk.MenuToolButtonis a- Gtk.ToolItemthat contains a button and a small additional button with an arrow. When clicked, the arrow button pops up a dropdown menu.- Use - Gtk.MenuToolButton.new() to create a new- Gtk.MenuToolButton.- The - Gtk.MenuToolButtonimplementation of the- Gtk.Buildableinterface 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>- 
classmethod new(icon_widget, label)[source]¶
- Parameters: - Returns: - the new - Gtk.MenuToolButton- Return type: - Creates a new - Gtk.MenuToolButtonusing icon_widget as icon and label as label.- New in version 2.6. 
 - 
classmethod new_from_stock(stock_id)[source]¶
- Parameters: - stock_id ( - str) – the name of a stock item- Returns: - the new - Gtk.MenuToolButton- Return type: - Gtk.ToolItem- Creates a new - Gtk.MenuToolButton. The new- Gtk.MenuToolButtonwill contain an icon and label from the stock item indicated by stock_id.- New in version 2.6. - Deprecated since version 3.10: Use - Gtk.MenuToolButton.new() instead.
 - 
get_menu()[source]¶
- Returns: - the - Gtk.Menuassociated with- Gtk.MenuToolButton- Return type: - Gtk.Widget- Gets the - Gtk.Menuassociated with- Gtk.MenuToolButton.- New in version 2.6. 
 - 
set_arrow_tooltip_markup(markup)[source]¶
- Parameters: - markup ( - str) – markup text to be used as tooltip text for button’s arrow button- Sets the tooltip markup text to be used as tooltip for the arrow button which pops up the menu. See - Gtk.ToolItem.set_tooltip_text() for setting a tooltip on the whole- Gtk.MenuToolButton.- New in version 2.12. 
 - 
set_arrow_tooltip_text(text)[source]¶
- Parameters: - text ( - str) – text to be used as tooltip text for button’s arrow button- Sets the tooltip text to be used as tooltip for the arrow button which pops up the menu. See - Gtk.ToolItem.set_tooltip_text() for setting a tooltip on the whole- Gtk.MenuToolButton.- New in version 2.12. 
 - 
set_menu(menu)[source]¶
- Parameters: - menu ( - Gtk.Widget) – the- Gtk.Menuassociated with- Gtk.MenuToolButton- Sets the - Gtk.Menuthat is popped up when the user clicks on the arrow. If menu is- None, the arrow button becomes insensitive.- New in version 2.6. 
 - 
do_show_menu() virtual¶
 
- 
classmethod 
Signal Details¶
- 
Gtk.MenuToolButton.signals.show_menu(menu_tool_button)¶
- Signal Name: - show-menu- Flags: - RUN_FIRST- Parameters: - menu_tool_button ( - Gtk.MenuToolButton) – The object which received the signal- The - ::show-menusignal is emitted before the menu is shown.- It can be used to populate the menu on demand, using - Gtk.MenuToolButton.set_menu().- Note that even if you populate the menu dynamically in this way, you must set an empty menu on the - Gtk.MenuToolButtonbeforehand, since the arrow is made insensitive if the menu is not set.