| Top |
| CtkToolItem * | ctk_tool_button_new () |
| CtkToolItem * | ctk_tool_button_new_from_stock () |
| void | ctk_tool_button_set_label () |
| const gchar * | ctk_tool_button_get_label () |
| void | ctk_tool_button_set_use_underline () |
| gboolean | ctk_tool_button_get_use_underline () |
| void | ctk_tool_button_set_stock_id () |
| const gchar * | ctk_tool_button_get_stock_id () |
| void | ctk_tool_button_set_icon_name () |
| const gchar * | ctk_tool_button_get_icon_name () |
| void | ctk_tool_button_set_icon_widget () |
| CtkWidget * | ctk_tool_button_get_icon_widget () |
| void | ctk_tool_button_set_label_widget () |
| CtkWidget * | ctk_tool_button_get_label_widget () |
| char * | icon-name | Read / Write |
| CtkWidget * | icon-widget | Read / Write |
| char * | label | Read / Write |
| CtkWidget * | label-widget | Read / Write |
| char * | stock-id | Read / Write |
| gboolean | use-underline | Read / Write |
GObject
╰── GInitiallyUnowned
╰── CtkWidget
╰── CtkContainer
╰── CtkBin
╰── CtkToolItem
╰── CtkToolButton
├── CtkMenuToolButton
╰── CtkToggleToolButton
CtkToolButton implements AtkImplementorIface, CtkBuildable, CtkActivatable and CtkActionable.
CtkToolButtons are CtkToolItems containing buttons.
Use ctk_tool_button_new() to create a new CtkToolButton.
The label of a CtkToolButton is determined by the properties
“label-widget”, “label”, and
“stock-id”. If “label-widget” is
non-NULL, then that widget is used as the label. Otherwise, if
“label” is non-NULL, that string is used as the label.
Otherwise, if “stock-id” is non-NULL, the label is
determined by the stock item. Otherwise, the button does not have a label.
The icon of a CtkToolButton is determined by the properties
“icon-widget” and “stock-id”. If
“icon-widget” is non-NULL, then
that widget is used as the icon. Otherwise, if “stock-id” is
non-NULL, the icon is determined by the stock item. Otherwise,
the button does not have a icon.
CtkToolItem * ctk_tool_button_new (CtkWidget *icon_widget,const gchar *label);
Creates a new CtkToolButton using icon_widget
as contents and label
as
label.
label |
a string that will be used as label, or |
[allow-none] |
icon_widget |
a widget that will be used as the button contents, or |
[allow-none] |
Since: 2.4
CtkToolItem *
ctk_tool_button_new_from_stock (const gchar *stock_id);
Creates a new CtkToolButton containing the image and text from a stock item. Some stock ids have preprocessor macros like CTK_STOCK_OK and CTK_STOCK_APPLY.
It is an error if stock_id
is not a name of a stock item.
Since: 2.4
void ctk_tool_button_set_label (CtkToolButton *button,const gchar *label);
Sets label
as the label used for the tool button. The “label”
property only has an effect if not overridden by a non-NULL
“label-widget” property. If both the “label-widget”
and “label” properties are NULL, the label is determined by the
“stock-id” property. If the “stock-id” property is
also NULL, button
will not have a label.
Since: 2.4
const gchar *
ctk_tool_button_get_label (CtkToolButton *button);
Returns the label used by the tool button, or NULL if the tool button
doesn’t have a label. or uses a the label from a stock item. The returned
string is owned by CTK+, and must not be modified or freed.
Since: 2.4
void ctk_tool_button_set_use_underline (CtkToolButton *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 use_underline
is TRUE,
the label on the tool button will be “Open” and the item on the overflow
menu will have an underlined “O”.
Labels shown on tool buttons never have mnemonics on them; this property only affects the menu item on the overflow menu.
Since: 2.4
gboolean
ctk_tool_button_get_use_underline (CtkToolButton *button);
Returns whether underscores in the label property are used as mnemonics
on menu items on the overflow menu. See ctk_tool_button_set_use_underline().
TRUE if underscores in the label property are used as
mnemonics on menu items on the overflow menu.
Since: 2.4
void ctk_tool_button_set_stock_id (CtkToolButton *button,const gchar *stock_id);
Sets the name of the stock item. See ctk_tool_button_new_from_stock().
The stock_id property only has an effect if not overridden by non-NULL
“label-widget” and “icon-widget” properties.
Since: 2.4
const gchar *
ctk_tool_button_get_stock_id (CtkToolButton *button);
Returns the name of the stock item. See ctk_tool_button_set_stock_id().
The returned string is owned by CTK+ and must not be freed or modifed.
Since: 2.4
void ctk_tool_button_set_icon_name (CtkToolButton *button,const gchar *icon_name);
Sets the icon for the tool button from a named themed icon.
See the docs for CtkIconTheme for more details.
The “icon-name” property only has an effect if not
overridden by non-NULL “label-widget”,
“icon-widget” and “stock-id” properties.
Since: 2.8
const gchar *
ctk_tool_button_get_icon_name (CtkToolButton *button);
Returns the name of the themed icon for the tool button,
see ctk_tool_button_set_icon_name().
Since: 2.8
void ctk_tool_button_set_icon_widget (CtkToolButton *button,CtkWidget *icon_widget);
Sets icon
as the widget used as icon on button
. If icon_widget
is
NULL the icon is determined by the “stock-id” property. If the
“stock-id” property is also NULL, button
will not have an icon.
Since: 2.4
CtkWidget *
ctk_tool_button_get_icon_widget (CtkToolButton *button);
Return the widget used as icon widget on button
.
See ctk_tool_button_set_icon_widget().
Since: 2.4
void ctk_tool_button_set_label_widget (CtkToolButton *button,CtkWidget *label_widget);
Sets label_widget
as the widget that will be used as the label
for button
. If label_widget
is NULL the “label” property is used
as label. If “label” is also NULL, the label in the stock item
determined by the “stock-id” property is used as label. If
“stock-id” is also NULL, button
does not have a label.
Since: 2.4
CtkWidget *
ctk_tool_button_get_label_widget (CtkToolButton *button);
Returns the widget used as label on button
.
See ctk_tool_button_set_label_widget().
Since: 2.4
“icon-name” property “icon-name” char *
The name of the themed icon displayed on the item. This property only has an effect if not overridden by “label-widget”, “icon-widget” or “stock-id” properties.
Owner: CtkToolButton
Flags: Read / Write
Default value: NULL
Since: 2.8
“icon-widget” property“icon-widget” CtkWidget *
Icon widget to display in the item.
Owner: CtkToolButton
Flags: Read / Write
“label” property “label” char *
Text to show in the item.
Owner: CtkToolButton
Flags: Read / Write
Default value: NULL
“label-widget” property“label-widget” CtkWidget *
Widget to use as the item label.
Owner: CtkToolButton
Flags: Read / Write
“stock-id” property “stock-id” char *
The stock icon displayed on the item.
CtkToolButton:stock-id has been deprecated since version 3.10 and should not be used in newly-written code.
Use “icon-name” instead.
Owner: CtkToolButton
Flags: Read / Write
Default value: NULL
“clicked” signalvoid user_function (CtkToolButton *toolbutton, gpointer user_data)
This signal is emitted when the tool button is clicked with the mouse or activated with the keyboard.
toolbutton |
the object that emitted the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action