A
gtk-menu-tool-button is a
gtk-tool-item that contains a
button and a small additional button with an arrow.
When clicked, the arrow button pops up a dropdown menu.
Use the function
gtk-menu-tool-button-new to create a new
gtk-menu-tool-button. Use the function
gtk-menu-tool-button-new-from-stock to create a new
gtk-menu-tool-button containing a stock item.
GtkMenuToolButton as GtkBuildable
The
gtk-menu-tool-button implementation of the
gtk-buildable
interface supports adding a menu by specifying "menu" as the "type" attribute of a
<child> element.
Example: A UI definition fragment with menus
<object class="GtkMenuToolButton">
<child type="menu">
<object class="GtkMenu"/>
</child>
</object>
Signal Details
The "show-menu" signal
lambda (button) : Run First
The "show-menu" signal is emitted before the menu is shown. It can be
used to populate the menu on demand, using the function
gtk-menu-tool-button-menu. Note that even if you populate the menu
dynamically in this way, you must set an empty menu on the
gtk-menu-tool-button beforehand, since the arrow is made
insensitive if the menu is not set.
- button
- The gtk-menu-tool-button widget on which the signal is emitted.