Gtk.CheckButton

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Activatable Gtk.Activatable GObject.GInterface->Gtk.Activatable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Button Gtk.Button Gtk.Actionable->Gtk.Button Gtk.Activatable->Gtk.Button Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.Button Gtk.Buildable->Gtk.Widget Gtk.ToggleButton Gtk.ToggleButton Gtk.Button->Gtk.ToggleButton Gtk.CheckButton Gtk.CheckButton Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.ToggleButton->Gtk.CheckButton Gtk.Widget->Gtk.Container

Example

../_images/CheckButton.png
Subclasses:Gtk.RadioButton

Style Properties

Inherited:Gtk.Button (7), Gtk.Widget (17)
Name Type Default Flags Short Description
indicator-size int 16 d/r Size of check or radio indicator deprecated
indicator-spacing int 2 d/r Spacing around check or radio indicator deprecated

Fields

Inherited:Gtk.ToggleButton (1), Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)
Name Type Access Description
toggle_button Gtk.ToggleButton r  

Class Details

class Gtk.CheckButton(*args, **kwargs)
Bases:Gtk.ToggleButton
Abstract:No
Structure:Gtk.CheckButtonClass

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

CSS nodes
checkbutton
├── check
╰── <child>

A Gtk.CheckButton with indicator (see Gtk.ToggleButton.set_mode()) has a main CSS node with name checkbutton and a subnode with name check.

button.check
├── check
╰── <child>

A Gtk.CheckButton 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.

classmethod new()[source]
Returns:a Gtk.Widget.
Return type:Gtk.Widget

Creates a new Gtk.CheckButton.

classmethod new_with_label(label)[source]
Parameters:label (str) – the text for the check button.
Returns:a Gtk.Widget.
Return type:Gtk.Widget

Creates a new Gtk.CheckButton with a Gtk.Label to the right of it.

classmethod new_with_mnemonic(label)[source]
Parameters:label (str) – The text of the button, with an underscore in front of the mnemonic character
Returns:a new Gtk.CheckButton
Return type:Gtk.Widget

Creates a new Gtk.CheckButton 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.

do_draw_indicator(cr) virtual
Parameters:cr (cairo.Context) –