Synopsis#include <gtk/gtk.h> GtkToolButton; GtkToolItem* gtk_tool_button_new (GtkWidget *icon_widget, const gchar *label); GtkToolItem* gtk_tool_button_new_from_stock (const gchar *stock_id); void gtk_tool_button_set_label (GtkToolButton *button, const gchar *label); const gchar* gtk_tool_button_get_label (GtkToolButton *button); void gtk_tool_button_set_use_underline (GtkToolButton *button, gboolean use_underline); gboolean gtk_tool_button_get_use_underline (GtkToolButton *button); void gtk_tool_button_set_stock_id (GtkToolButton *button, const gchar *stock_id); const gchar* gtk_tool_button_get_stock_id (GtkToolButton *button); void gtk_tool_button_set_icon_name (GtkToolButton *button, const gchar *icon_name); const gchar* gtk_tool_button_get_icon_name (GtkToolButton *button); void gtk_tool_button_set_icon_widget (GtkToolButton *button, GtkWidget *icon_widget); GtkWidget* gtk_tool_button_get_icon_widget (GtkToolButton *button); void gtk_tool_button_set_label_widget (GtkToolButton *button, GtkWidget *label_widget); GtkWidget* gtk_tool_button_get_label_widget (GtkToolButton *button); Object HierarchyGObject +----GInitiallyUnowned +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkToolItem +----GtkToolButton +----GtkMenuToolButton +----GtkToggleToolButton Properties"icon-name" gchar* : Read / Write "icon-widget" GtkWidget* : Read / Write "label" gchar* : Read / Write "label-widget" GtkWidget* : Read / Write "stock-id" gchar* : Read / Write "use-underline" gboolean : Read / Write DescriptionGtkToolButtons are GtkToolItems containing buttons.
Use
The label of a GtkToolButton is determined by the properties
"label-widget", "label", and "stock-id". If "label-widget" is
non-
The icon of a GtkToolButton is determined by the properties
"icon-widget" and "stock-id". If "icon-widget" is non- DetailsGtkToolButtontypedef struct _GtkToolButton GtkToolButton; The GtkToolButton struct contains only private. It should only be accessed with the function described below. gtk_tool_button_new ()GtkToolItem* gtk_tool_button_new (GtkWidget *icon_widget, const gchar *label);
Creates a new
Since 2.4 gtk_tool_button_new_from_stock ()GtkToolItem* gtk_tool_button_new_from_stock (const gchar *stock_id); Creates a new GtkToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like GTK_STOCK_OK and GTK_STOCK_APPLY.
It is an error if
Since 2.4 gtk_tool_button_set_label ()void gtk_tool_button_set_label (GtkToolButton *button, const gchar *label);
Sets
Since 2.4 gtk_tool_button_get_label ()const gchar* gtk_tool_button_get_label (GtkToolButton *button);
Returns the label used by the tool button, or
Since 2.4 gtk_tool_button_set_use_underline ()void gtk_tool_button_set_use_underline (GtkToolButton *button, gboolean use_underline);
If set, an underline in the label property indicates that the next character
should be used for the mnemonic accelerator key in the overflow menu. For
example, if the label property is "_Open" and Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu.
Since 2.4 gtk_tool_button_get_use_underline ()gboolean gtk_tool_button_get_use_underline (GtkToolButton *button);
Returns whether underscores in the label property are used as mnemonics
on menu items on the overflow menu. See
Since 2.4 gtk_tool_button_set_stock_id ()void gtk_tool_button_set_stock_id (GtkToolButton *button, const gchar *stock_id);
Sets the name of the stock item. See
Since 2.4 gtk_tool_button_get_stock_id ()const gchar* gtk_tool_button_get_stock_id (GtkToolButton *button);
Returns the name of the stock item. See
Since 2.4 gtk_tool_button_set_icon_name ()void gtk_tool_button_set_icon_name (GtkToolButton *button, const gchar *icon_name);
Sets the icon for the tool button from a named themed icon.
See the docs for GtkIconTheme for more details.
The "icon_name" property only has an effect if not
overridden by non-
Since 2.8 gtk_tool_button_get_icon_name ()const gchar* gtk_tool_button_get_icon_name (GtkToolButton *button);
Returns the name of the themed icon for the tool button,
see
Since 2.8 gtk_tool_button_set_icon_widget ()void gtk_tool_button_set_icon_widget (GtkToolButton *button, GtkWidget *icon_widget);
Sets
Since 2.4 gtk_tool_button_get_icon_widget ()GtkWidget* gtk_tool_button_get_icon_widget (GtkToolButton *button);
Return the widget used as icon widget on
Since 2.4 gtk_tool_button_set_label_widget ()void gtk_tool_button_set_label_widget (GtkToolButton *button, GtkWidget *label_widget);
Sets
Since 2.4 gtk_tool_button_get_label_widget ()GtkWidget* gtk_tool_button_get_label_widget (GtkToolButton *button);
Returns the widget used as label on
Since 2.4 Property DetailsThe
|
|
the object that emitted the signal |
|
user data set when the signal handler was connected. |
The toolbar widget |
|
A subclass of GtkToolButton that displays on the toolbar a button with an additional dropdown menu |
|
A subclass of GtkToolButton that displays toggle buttons on the toolbar |
|
A subclass of GtkToolButton that displays radio buttons on the toolbar |
|
A subclass of GtkToolItem that separates groups of items on a toolbar |