gtk.check_button
Module for [CheckButton] class
Types 3
A gtk.check_button.CheckButton places a label next to an indicator.
A gtk.check_button.CheckButton is created by calling either gtk.check_button.CheckButton.new_ or gtk.check_button.CheckButton.newWithLabel.
The state of a gtk.check_button.CheckButton can be set specifically using gtk.check_button.CheckButton.setActive, and retrieved using gtk.check_button.CheckButton.getActive.
Inconsistent state
In addition to "on" and "off", check buttons can be an "in between" state that is neither on nor off. This can be used e.g. when 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.
To set a gtk.check_button.CheckButton to inconsistent state, use gtk.check_button.CheckButton.setInconsistent.
Grouping
Check buttons can be grouped together, to form mutually exclusive groups - only one of the buttons can be toggled at a time, and toggling another one will switch the currently toggled one off.
Grouped check buttons use a different indicator, and are commonly referred to as radio buttons.
To add a gtk.check_button.CheckButton to a group, use gtk.check_button.CheckButton.setGroup.
When the code must keep track of the state of a group of radio buttons, it is recommended to keep track of such state through a stateful gio.action.Action with a target for each button. Using the toggled signals to keep track of the group changes and state is discouraged.
CSS nodes
checkbutton[.text-button]
├── check
╰── [label]A gtk.check_button.CheckButton has a main node with name checkbutton. If the gtk.check_button.CheckButton.label or gtk.check_button.CheckButton.child properties are set, it contains a child widget. The indicator node is named check when no group is set, and radio if the checkbutton is grouped together with other checkbuttons.
Accessibility
gtk.check_button.CheckButton uses the gtk.types.AccessibleRole.Checkbox role.
CheckButtonGidBuilder builder() static nothrowGet builder for [gtk.check_button.CheckButton] Returns: New builder objectvoid active(bool propval) @property nothrowSet `active` property. Params: propval = If the check button is active.void child(gtk.widget.Widget propval) @property nothrowSet `child` property. Params: propval = The child widget.void group(gtk.check_button.CheckButton propval) @property nothrowSet `group` property. Params: propval = The check button whose group this widget belongs to.bool inconsistent() @property nothrowGet `inconsistent` property. Returns: If the check button is in an “in between” state.void inconsistent(bool propval) @property nothrowSet `inconsistent` property. Params: propval = If the check button is in an “in between” state.string label() @property nothrowGet `label` property. Returns: Text of the label inside the check button, if it contains a label widget.void label(string propval) @property nothrowSet `label` property. Params: propval = Text of the label inside the check button, if it contains a label widget.bool useUnderline() @property nothrowGet `useUnderline` property. Returns: If set, an underline in the text indicates that the following character is to be used as mnemonic.void useUnderline(bool propval) @property nothrowSet `useUnderline` property. Params: propval = If set, an underline in the text indicates that the following character is to be used as mnemonic.gtk.check_button.CheckButton newWithLabel(string label = null) static nothrowCreates a new [gtk.check_button.CheckButton] with the given text.gtk.check_button.CheckButton newWithMnemonic(string label = null) static nothrowCreates a new [gtk.check_button.CheckButton] with the given text and a mnemonic.bool getActive() nothrowReturns whether the check button is active. Returns: whether the check button is activegtk.widget.Widget getChild() nothrowGets the child widget of button or `NULL` if [gtk.check_button.CheckButton.label] is set. Returns: the child widget of buttonbool getInconsistent() nothrowReturns whether the check button is in an inconsistent state. Returns: true if check_button is currently in an inconsistent statestring getLabel() nothrowReturns the label of the check button or `NULL` if [gtk.check_button.CheckButton.child] is set. Returns: The label self shows next to the indicator. If no label is shown, null will be returned.bool getUseUnderline() nothrowReturns whether underlines in the label indicate mnemonics. Returns: The value of the [gtk.check_button.CheckButton.useUnderline] property. See [gtk.check_button.CheckButton.setUseUnderline] for de...void setInconsistent(bool inconsistent) nothrowSets the [gtk.check_button.CheckButton] to inconsistent state.gulong connectActivate(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.check_button.CheckButton)))
&& Parameters!T.length < 2) nothrowConnect to `Activate` signal.gulong connectToggled(T)(T callback, Flag!"After" after = No.After) if (isCallable!T
&& is(ReturnType!T == void)
&& (Parameters!T.length < 1 || (ParameterStorageClassTuple!T[0] == ParameterStorageClass.none && is(Parameters!T[0] : gtk.check_button.CheckButton)))
&& Parameters!T.length < 2) nothrowConnect to `Toggled` signal.Fluent builder implementation template for gtk.check_button.CheckButton
T active(bool propval) nothrowSet `active` property. Params: propval = If the check button is active.T child(gtk.widget.Widget propval) nothrowSet `child` property. Params: propval = The child widget. Returns: Builder instance for fluent chainingT group(gtk.check_button.CheckButton propval) nothrowSet `group` property. Params: propval = The check button whose group this widget belongs to. Returns: Builder instance for fluent chainingT inconsistent(bool propval) nothrowSet `inconsistent` property. Params: propval = If the check button is in an “in between” state.T label(string propval) nothrowSet `label` property. Params: propval = Text of the label inside the check button, if it contains a label widget. Returns: Builder instance for fluent chainingT useUnderline(bool propval) nothrowSet `useUnderline` property. Params: propval = If set, an underline in the text indicates that the following character is to be used as mnemonic. Returns: Builder instance for fluent chainingFluent builder for gtk.check_button.CheckButton