gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.CheckButton

Description

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

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

CSS nodes

plain code

checkbutton
├── check
╰── <child>

A GtkCheckButton with indicator (see checkButtonSetDrawIndicator) has a main CSS node with name checkbutton and a subnode with name check.

plain code

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.

Synopsis

Exported types

newtype CheckButton Source #

Memory-managed wrapper type.

class (GObject o, IsDescendantOf CheckButton o) => IsCheckButton o Source #

Type class for types which can be safely cast to CheckButton, for instance with toCheckButton.

Instances

Instances details
(GObject o, IsDescendantOf CheckButton o) => IsCheckButton o Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

toCheckButton :: (MonadIO m, IsCheckButton o) => o -> m CheckButton Source #

Cast to CheckButton, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getDrawIndicator

checkButtonGetDrawIndicator Source #

Arguments

:: (HasCallStack, MonadIO m, IsCheckButton a) 
=> a

checkButton: a CheckButton

-> m Bool

Returns: The value of the GtkCheckButton:draw-indicator property.

Returns Whether or not the indicator part of the button gets drawn.

getInconsistent

checkButtonGetInconsistent Source #

Arguments

:: (HasCallStack, MonadIO m, IsCheckButton a) 
=> a

checkButton: a CheckButton

-> m Bool

Returns: True if checkButton is currently in an 'in between' state, False otherwise.

Returns whether the check button is in an inconsistent state.

new

checkButtonNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m CheckButton

Returns: a Widget.

Creates a new CheckButton.

newWithLabel

checkButtonNewWithLabel Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

label: the text for the check button.

-> m CheckButton

Returns: a Widget.

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

newWithMnemonic

checkButtonNewWithMnemonic Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

label: The text of the button, with an underscore in front of the mnemonic character

-> m CheckButton

Returns: a new CheckButton

Creates a new CheckButton containing a label. The label will be created using labelNewWithMnemonic, so underscores in label indicate the mnemonic for the check button.

setDrawIndicator

checkButtonSetDrawIndicator Source #

Arguments

:: (HasCallStack, MonadIO m, IsCheckButton a) 
=> a

checkButton: a CheckButton

-> Bool

drawIndicator: Whether or not to draw the indicator part of the button

-> m () 

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 StackSwitcher.

setInconsistent

checkButtonSetInconsistent Source #

Arguments

:: (HasCallStack, MonadIO m, IsCheckButton a) 
=> a

checkButton: a CheckButton

-> Bool

inconsistent: True if state is inconsistent

-> m () 

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.

Properties

drawIndicator

No description available in the introspection data.

constructCheckButtonDrawIndicator :: (IsCheckButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “draw-indicator” property. This is rarely needed directly, but it is used by new.

getCheckButtonDrawIndicator :: (MonadIO m, IsCheckButton o) => o -> m Bool Source #

Get the value of the “draw-indicator” property. When overloading is enabled, this is equivalent to

get checkButton #drawIndicator

setCheckButtonDrawIndicator :: (MonadIO m, IsCheckButton o) => o -> Bool -> m () Source #

Set the value of the “draw-indicator” property. When overloading is enabled, this is equivalent to

set checkButton [ #drawIndicator := value ]

inconsistent

No description available in the introspection data.

constructCheckButtonInconsistent :: (IsCheckButton o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “inconsistent” property. This is rarely needed directly, but it is used by new.

getCheckButtonInconsistent :: (MonadIO m, IsCheckButton o) => o -> m Bool Source #

Get the value of the “inconsistent” property. When overloading is enabled, this is equivalent to

get checkButton #inconsistent

setCheckButtonInconsistent :: (MonadIO m, IsCheckButton o) => o -> Bool -> m () Source #

Set the value of the “inconsistent” property. When overloading is enabled, this is equivalent to

set checkButton [ #inconsistent := value ]