Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gtk_check_button_new () |
GtkWidget * | gtk_check_button_new_with_label () |
GtkWidget * | gtk_check_button_new_with_mnemonic () |
gboolean | gtk_check_button_get_draw_indicator () |
void | gtk_check_button_set_draw_indicator () |
gboolean | gtk_check_button_get_inconsistent () |
void | gtk_check_button_set_inconsistent () |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkButton ╰── GtkToggleButton ╰── GtkCheckButton ╰── GtkRadioButton
GtkCheckButton implements AtkImplementorIface, GtkBuildable and GtkActionable.
A GtkCheckButton places a discrete GtkToggleButton next to a widget, (usually a GtkLabel). See the section on GtkToggleButton widgets for more information about toggle/check buttons.
The important signal ( “toggled” ) is also inherited from GtkToggleButton.
checkbutton ├── check ╰── <child>
A GtkCheckButton with indicator (see gtk_check_button_set_draw_indicator()
) has a
main CSS node with name checkbutton and a subnode with name check.
button.check ├── check ╰── <child>
A GtkCheckButton without indicator changes the name of its main node to button and adds a .check style class to it. The subnode is invisible in this case.
GtkWidget *
gtk_check_button_new_with_label (const gchar *label
);
Creates a new GtkCheckButton with a GtkLabel to the right of it.
GtkWidget *
gtk_check_button_new_with_mnemonic (const gchar *label
);
Creates a new GtkCheckButton containing a label. The label
will be created using gtk_label_new_with_mnemonic()
, so underscores
in label
indicate the mnemonic for the check button.
gboolean
gtk_check_button_get_draw_indicator (GtkCheckButton *check_button
);
Returns Whether or not the indicator part of the button gets drawn.
void gtk_check_button_set_draw_indicator (GtkCheckButton *check_button
,gboolean draw_indicator
);
Sets whether the indicator part of the button is drawn. This is important for cases where the check button should have the functinality of a check button, but the visuals of a regular button, like in a GtkStackSwitcher.
gboolean
gtk_check_button_get_inconsistent (GtkCheckButton *check_button
);
void gtk_check_button_set_inconsistent (GtkCheckButton *check_button
,gboolean inconsistent
);
If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a check button, and the current values in that range are inconsistent, you may want to display the toggle in an "in between" state. Normally you would turn off the inconsistent state again if the user checks the check button. This has to be done manually, gtk_check_button_set_inconsistent only affects visual appearance, not the semantics of the button.