Gtk.MenuToolButton¶
- Subclasses:
None
Methods¶
- Inherited:
Gtk.ToolButton (14), Gtk.ToolItem (28), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Activatable (6), Gtk.Actionable (5)
- Structs:
Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)
class |
|
class |
|
|
|
|
|
|
|
|
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)
|
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 |
|---|---|---|---|
r/w |
The dropdown menu |
Style Properties¶
- Inherited:
Signals¶
- Inherited:
Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Short Description |
|---|---|
The |
Fields¶
- Inherited:
Gtk.ToolButton (1), Gtk.ToolItem (2), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name |
Type |
Access |
Description |
|---|---|---|---|
parent |
r |
Class Details¶
- class Gtk.MenuToolButton(*args, **kwargs)¶
- Bases:
- Abstract:
No
- Structure:
A
Gtk.MenuToolButtonis aGtk.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 newGtk.MenuToolButton.The
Gtk.MenuToolButtonimplementation of theGtk.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:
Creates a new
Gtk.MenuToolButton. The newGtk.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 withGtk.MenuToolButton- Return type:
Gets the
Gtk.Menuassociated withGtk.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 wholeGtk.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 wholeGtk.MenuToolButton.New in version 2.12.
- set_menu(menu)[source]¶
- Parameters:
menu (
Gtk.Widget) – theGtk.Menuassociated withGtk.MenuToolButton
Sets the
Gtk.Menuthat is popped up when the user clicks on the arrow. If menu isNone, the arrow button becomes insensitive.New in version 2.6.
- do_show_menu() virtual¶
Signal emitted before the menu is shown.
Signal Details¶
- Gtk.MenuToolButton.signals.show_menu(menu_tool_button)¶
- Signal Name:
show-menu- Flags:
- 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.