GTK+ Reference Manual |
---|
GtkMenuToolButtonGtkMenuToolButton — A GtkToolItem containing a button with an additional dropdown menu |
#include <gtk/gtk.h> GtkMenuToolButton; GtkToolItem* gtk_menu_tool_button_new (GtkWidget *icon_widget, const gchar *label); GtkToolItem* gtk_menu_tool_button_new_from_stock (const gchar *stock_id); void gtk_menu_tool_button_set_menu (GtkMenuToolButton *button, GtkWidget *menu); GtkWidget* gtk_menu_tool_button_get_menu (GtkMenuToolButton *button); void gtk_menu_tool_button_set_arrow_tooltip (GtkMenuToolButton *button, GtkTooltips *tooltips, const gchar *tip_text, const gchar *tip_private);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkToolItem +----GtkToolButton +----GtkMenuToolButton
"show-menu" void user_function (GtkMenuToolButton *menutoolbutton, gpointer user_data);
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. Use gtk_toggle_tool_button_new_from_stock() to create a new GtkMenuToolButton containing a stock item.
typedef struct _GtkMenuToolButton GtkMenuToolButton;
The GtkMenuToolButton struct contains only private data and should only be accessed through the functions described below.
GtkToolItem* gtk_menu_tool_button_new (GtkWidget *icon_widget, const gchar *label);
Creates a new GtkMenuToolButton using icon_widget as icon and label as label.
icon_widget : | a widget that will be used as icon widget, or NULL |
label : | a string that will be used as label, or NULL |
Returns : | the new GtkMenuToolButton |
Since 2.6
GtkToolItem* gtk_menu_tool_button_new_from_stock (const gchar *stock_id);
Creates a new GtkMenuToolButton. The new GtkMenuToolButton will contain an icon and label from the stock item indicated by stock_id.
stock_id : | the name of a stock item |
Returns : | the new GtkMenuToolButton |
Since 2.6
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.
button : | a GtkMenuToolButton |
menu : | the GtkMenu associated with GtkMenuToolButton |
Since 2.6
GtkWidget* gtk_menu_tool_button_get_menu (GtkMenuToolButton *button);
Gets the GtkMenu associated with GtkMenuToolButton.
button : | a GtkMenuToolButton |
Returns : | the GtkMenu associated with GtkMenuToolButton |
Since 2.6
void gtk_menu_tool_button_set_arrow_tooltip (GtkMenuToolButton *button, GtkTooltips *tooltips, const gchar *tip_text, const gchar *tip_private);
button : | |
tooltips : | |
tip_text : | |
tip_private : |
void user_function (GtkMenuToolButton *menutoolbutton, gpointer user_data);
menutoolbutton : | the object which received the signal. |
user_data : | user data set when the signal handler was connected. |
The toolbar widget
The parent class of GtkMenuToolButton. The properties "label_widget", "label", "icon_widget", and "stock_id" on GtkToolButton determine the label and icon used on GtkMenuToolButtons.
<< GtkToolButton | GtkToggleToolButton >> |