CheckButton

A gtk.CheckButton places a discrete gtk.ToggleButton next to a widget, (usually a gtk.Label). See the section on gtk.ToggleButton widgets for more information about toggle/check buttons.

The important signal ( toggled ) is also inherited from gtk.ToggleButton

CSS nodes

|[<!-- language="plain" --> checkbutton ├── check ╰── <child>

A GtkCheckButton with indicator (see [gtk.ToggleButton.ToggleButton.setMode|ToggleButton.setMode]) has a
main CSS node with name checkbutton and a subnode with name check.

|[<!-- language="plain" -->
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(GtkCheckButton* gtkCheckButton, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(string label, bool mnemonic)

Creates a new GtkCheckButton with a GtkLabel to the right of it. If mnemonic is true the label will be created using Label.newWithMnemonic, so underscores in label indicate the mnemonic for the check button.

this
this(string label, void delegate(CheckButton) onClicked, bool mnemonic)
this
this()

Creates a new gtk.CheckButton

Members

Functions

getCheckButtonStruct
GtkCheckButton* getCheckButtonStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

Static functions

getType
GType getType()

Variables

gtkCheckButton
GtkCheckButton* gtkCheckButton;

the main Gtk struct

Inherited Members

From ToggleButton

gtkToggleButton
GtkToggleButton* gtkToggleButton;

the main Gtk struct

getToggleButtonStruct
GtkToggleButton* getToggleButtonStruct(bool transferOwnership)

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

getType
GType getType()
getActive
bool getActive()

Queries a gtk.ToggleButton 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 ToggleButton.setInconsistent.

getMode
bool getMode()

Retrieves whether the button is displayed as a separate indicator and label. See 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 toggled signal and the 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, 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 toggled signal on the gtk.ToggleButton There is no good reason for an application ever to call this function.

addOnToggled
gulong addOnToggled(void delegate(ToggleButton) dlg, ConnectFlags connectFlags)

Should be connected if you wish to perform an action whenever the gtk.ToggleButton's state is changed.