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.MenuToolButton
is aGtk.ToolItem
that 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.MenuToolButton
implementation of theGtk.Buildable
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>
- classmethod new(icon_widget, label)[source]¶
- Parameters:
- Returns:
the new
Gtk.MenuToolButton
- Return type:
Creates a new
Gtk.MenuToolButton
using 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.MenuToolButton
will 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.Menu
associated withGtk.MenuToolButton
- Return type:
Gets the
Gtk.Menu
associated 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.Menu
associated withGtk.MenuToolButton
Sets the
Gtk.Menu
that 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-menu
signal 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.MenuToolButton
beforehand, since the arrow is made insensitive if the menu is not set.