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

GI.Gtk.Objects.CheckButton

Description

A CheckButton places a label next to an indicator.

CSS nodes

plain code

checkbutton[.text-button]
├── check
╰── [label]

A CheckButton has a main node with name checkbutton. If the CheckButton:label property is set, it contains a label child. The indicator node is named check when no group is set, and radio if the checkbutton is grouped together with other checkbuttons.

Accessibility

GtkCheckButton uses the GTK_ACCESSIBLE_ROLE_CHECKBOX role.

Synopsis

Exported types

newtype CheckButton Source #

Memory-managed wrapper type.

Constructors

CheckButton (ManagedPtr CheckButton) 

Instances

Instances details
Eq CheckButton Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

GObject CheckButton Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

ManagedPtrNewtype CheckButton Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

Methods

toManagedPtr :: CheckButton -> ManagedPtr CheckButton

TypedObject CheckButton Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

Methods

glibType :: IO GType

HasParentTypes CheckButton Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

IsGValue (Maybe CheckButton) Source #

Convert CheckButton to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.CheckButton

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe CheckButton -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe CheckButton)

type ParentTypes CheckButton Source # 
Instance details

Defined in GI.Gtk.Objects.CheckButton

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

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleRole, getActionName, getActionTargetValue, getActive, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getInconsistent, getLabel, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getUseUnderline, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

Setters

setActionName, setActionTargetValue, setActive, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDetailedActionName, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setGroup, setHalign, setHasTooltip, setHexpand, setHexpandSet, setInconsistent, setLabel, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible.

getActive

checkButtonGetActive Source #

Arguments

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

self: a CheckButton

-> m Bool

Returns: The value of the CheckButton:active property. See checkButtonSetActive for details on how to set a new value.

Returns the current value of the CheckButton:active property.

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.

getLabel

checkButtonGetLabel Source #

Arguments

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

self: a CheckButton

-> m (Maybe Text)

Returns: The label self shows next to the indicator. If no label is shown, Nothing will be returned.

Returns the label of the checkbutton.

getUseUnderline

checkButtonGetUseUnderline Source #

Arguments

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

self: a CheckButton

-> m Bool

Returns: The value of the CheckButton:use-underline property. See checkButtonSetUseUnderline for details on how to set a new value.

Returns the current value of the CheckButton:use-underline property.

new

checkButtonNew Source #

Arguments

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

Returns: a Widget.

Creates a new CheckButton.

newWithLabel

checkButtonNewWithLabel Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

label: the text for the check button.

-> m CheckButton

Returns: a new CheckButton

Creates a new CheckButton with a Label next to it, if label is non-Nothing.

newWithMnemonic

checkButtonNewWithMnemonic Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe 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. Underscores in label indicate the mnemonic for the check button.

setActive

checkButtonSetActive Source #

Arguments

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

self: a CheckButton

-> Bool

setting: the new value to set

-> m () 

Sets the new value of the CheckButton:active property. See also checkButtonGetActive.

Setting CheckButton:active to True will add the :checked: state to both the checkbutton and the indicator CSS node.

setGroup

checkButtonSetGroup Source #

Arguments

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

self: a CheckButton

-> Maybe b

group: another CheckButton to form a group with

-> m () 

Adds self to the group of group. In a group of multiple check buttons, only one button can be active at a time.

Setting the group of a check button also changes the css name of the indicator widget's CSS node to 'radio'.

The behavior of a checkbutton in a group is also commonly known as a 'radio button'.

Note that the same effect can be achieved via the Actionable api, by using the same action with parameter type and state type 's' for all buttons in the group, and giving each button its own target value.

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.

setLabel

checkButtonSetLabel Source #

Arguments

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

self: a CheckButton

-> Maybe Text

label: The text shown next to the indicator, or Nothing to show no text

-> m () 

Sets the text of self. If CheckButton:use-underline is True, the underscore in label is interpreted as mnemonic indicator, see checkButtonSetUseUnderline for details on this behavior.

setUseUnderline

checkButtonSetUseUnderline Source #

Arguments

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

self: a CheckButton

-> Bool

setting: the new value to set

-> m () 

Sets the new value of the CheckButton:use-underline property. See also checkButtonGetUseUnderline.

If setting is True, an underscore character in self's label indicates a mnemonic accelerator key. This behavior is similar to Label:use-underline.

Properties

active

No description available in the introspection data.

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

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

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

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

get checkButton #active

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

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

set checkButton [ #active := value ]

group

No description available in the introspection data.

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

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

clear #group

constructCheckButtonGroup :: (IsCheckButton o, MonadIO m, IsCheckButton a) => a -> m (GValueConstruct o) Source #

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

setCheckButtonGroup :: (MonadIO m, IsCheckButton o, IsCheckButton a) => o -> a -> m () Source #

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

set checkButton [ #group := 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 ]

label

No description available in the introspection data.

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

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

clear #label

constructCheckButtonLabel :: (IsCheckButton o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getCheckButtonLabel :: (MonadIO m, IsCheckButton o) => o -> m (Maybe Text) Source #

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

get checkButton #label

setCheckButtonLabel :: (MonadIO m, IsCheckButton o) => o -> Text -> m () Source #

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

set checkButton [ #label := value ]

useUnderline

No description available in the introspection data.

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

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

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

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

get checkButton #useUnderline

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

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

set checkButton [ #useUnderline := value ]

Signals

toggled

type C_CheckButtonToggledCallback = Ptr () -> Ptr () -> IO () Source #

Type for the callback on the (unwrapped) C side.

type CheckButtonToggledCallback = IO () Source #

Emitted when the buttons's CheckButton:active flag changes.

afterCheckButtonToggled :: (IsCheckButton a, MonadIO m) => a -> CheckButtonToggledCallback -> m SignalHandlerId Source #

Connect a signal handler for the toggled signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after checkButton #toggled callback

onCheckButtonToggled :: (IsCheckButton a, MonadIO m) => a -> CheckButtonToggledCallback -> m SignalHandlerId Source #

Connect a signal handler for the toggled signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on checkButton #toggled callback