CheckButton

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 ( #GtkToggleButton::toggled ) is also inherited from #GtkToggleButton.

CSS nodes

checkbutton
├── check
╰── <child>

A GtkCheckButton with indicator (see gtk.toggle_button.ToggleButton.setMode) 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.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this()

Creates a new #GtkCheckButton.

Members

Functions

self
CheckButton self()

Returns this, for use in with statements.

Properties

_gType
GType _gType [@property getter]

Static functions

_getGType
GType _getGType()
builder
CheckButtonGidBuilder builder()

Get builder for gtk.check_button.CheckButton

newWithLabel
gtk.check_button.CheckButton newWithLabel(string label)

Creates a new #GtkCheckButton with a #GtkLabel to the right of it.

newWithMnemonic
gtk.check_button.CheckButton newWithMnemonic(string label)

Creates a new #GtkCheckButton containing a label. The label will be created using gtk.label.Label.newWithMnemonic, so underscores in label indicate the mnemonic for the check button.

Inherited Members

From ToggleButton

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
ToggleButton self()

Returns this, for use in with statements.

builder
ToggleButtonGidBuilder builder()

Get builder for gtk.toggle_button.ToggleButton

active
bool active [@property getter]
active
bool active [@property setter]
drawIndicator
bool drawIndicator [@property getter]
drawIndicator
bool drawIndicator [@property setter]
inconsistent
bool inconsistent [@property getter]
inconsistent
bool inconsistent [@property setter]
newWithLabel
gtk.toggle_button.ToggleButton newWithLabel(string label)

Creates a new toggle button with a text label.

newWithMnemonic
gtk.toggle_button.ToggleButton newWithMnemonic(string label)

Creates a new #GtkToggleButton containing a label. The label will be created using gtk.label.Label.newWithMnemonic, so underscores in label indicate the mnemonic for the button.

getActive
bool getActive()

Queries a #GtkToggleButton and returns its current state. Returns true if the toggle button is pressed in and false if it is raised.

getInconsistent
bool getInconsistent()

Gets the value set by gtk.toggle_button.ToggleButton.setInconsistent.

getMode
bool getMode()

Retrieves whether the button is displayed as a separate indicator and label. See gtk.toggle_button.ToggleButton.setMode.

setActive
void setActive(bool isActive)

Sets the status of the toggle button. Set to true if you want the GtkToggleButton to be “pressed in”, and false to raise it. This action causes the #GtkToggleButton::toggled signal and the #GtkButton::clicked signal to be emitted.

setInconsistent
void setInconsistent(bool setting)

If the user has selected a range of elements (such as some text or spreadsheet cells) that are affected by a toggle button, and the current values in that range are inconsistent, you may want to display the toggle in an “in between” state. This function turns on “in between” display. Normally you would turn off the inconsistent state again if the user toggles the toggle button. This has to be done manually, gtk.toggle_button.ToggleButton.setInconsistent only affects visual appearance, it doesn’t affect the semantics of the button.

setMode
void setMode(bool drawIndicator)

Sets whether the button is displayed as a separate indicator and label. You can call this function on a checkbutton or a radiobutton with draw_indicator = false to make the button look like a normal button.

toggled
void toggled()

Emits the #GtkToggleButton::toggled signal on the #GtkToggleButton. There is no good reason for an application ever to call this function.

connectToggled
gulong connectToggled(T callback, Flag!"After" after)

Connect to Toggled signal.