GtkMenuToolButton
GtkMenuToolButton — A GtkToolItem containing a button with an additional dropdown menu
|
|
Includes
#include <gtk/gtk.h>
Description
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.
Use gtk_menu_tool_button_new() to create a new
GtkMenuToolButton.
GtkMenuToolButton as GtkBuildable
The GtkMenuToolButton implementation of the GtkBuildable 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:
Functions
gtk_menu_tool_button_new_from_stock ()
GtkToolItem *
gtk_menu_tool_button_new_from_stock (const gchar *stock_id);
gtk_menu_tool_button_new_from_stock has been deprecated since version 3.10 and should not be used in newly-written code.
Use gtk_menu_tool_button_new() instead.
Creates a new GtkMenuToolButton.
The new GtkMenuToolButton will contain an icon and label from
the stock item indicated by stock_id
.
Since: 2.6
gtk_menu_tool_button_set_menu ()
void
gtk_menu_tool_button_set_menu (GtkMenuToolButton *button,
GtkWidget *menu);
Sets the GtkMenu that is popped up when the user clicks on the arrow.
If menu
is NULL, the arrow button becomes insensitive.
Since: 2.6
Types and Values
struct GtkMenuToolButton
struct GtkMenuToolButton;
struct GtkMenuToolButtonClass
struct GtkMenuToolButtonClass {
GtkToolButtonClass parent_class;
void (*show_menu) (GtkMenuToolButton *button);
};
Property Details
The “menu” property
“menu” GtkMenu *
The dropdown menu.
Owner: GtkMenuToolButton
Flags: Read / Write
Signal Details
The “show-menu” signal
void
user_function (GtkMenuToolButton *button,
gpointer user_data)
The ::show-menu signal is emitted before the menu is shown.
It can be used to populate the menu on demand, using
gtk_menu_tool_button_set_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.
Flags: Run First