| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte | 
|---|---|
| License | LGPL-2.1 | 
| Maintainer | Iñaki García Etxebarria | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
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
- newtype CheckButton = CheckButton (ManagedPtr CheckButton)
- class (GObject o, IsDescendantOf CheckButton o) => IsCheckButton o
- toCheckButton :: (MonadIO m, IsCheckButton o) => o -> m CheckButton
- checkButtonGetActive :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> m Bool
- checkButtonGetInconsistent :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> m Bool
- checkButtonGetLabel :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> m (Maybe Text)
- checkButtonGetUseUnderline :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> m Bool
- checkButtonNew :: (HasCallStack, MonadIO m) => m CheckButton
- checkButtonNewWithLabel :: (HasCallStack, MonadIO m) => Maybe Text -> m CheckButton
- checkButtonNewWithMnemonic :: (HasCallStack, MonadIO m) => Maybe Text -> m CheckButton
- checkButtonSetActive :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> Bool -> m ()
- checkButtonSetGroup :: (HasCallStack, MonadIO m, IsCheckButton a, IsCheckButton b) => a -> Maybe b -> m ()
- checkButtonSetInconsistent :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> Bool -> m ()
- checkButtonSetLabel :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> Maybe Text -> m ()
- checkButtonSetUseUnderline :: (HasCallStack, MonadIO m, IsCheckButton a) => a -> Bool -> m ()
- constructCheckButtonActive :: (IsCheckButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getCheckButtonActive :: (MonadIO m, IsCheckButton o) => o -> m Bool
- setCheckButtonActive :: (MonadIO m, IsCheckButton o) => o -> Bool -> m ()
- clearCheckButtonGroup :: (MonadIO m, IsCheckButton o) => o -> m ()
- constructCheckButtonGroup :: (IsCheckButton o, MonadIO m, IsCheckButton a) => a -> m (GValueConstruct o)
- setCheckButtonGroup :: (MonadIO m, IsCheckButton o, IsCheckButton a) => o -> a -> m ()
- constructCheckButtonInconsistent :: (IsCheckButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getCheckButtonInconsistent :: (MonadIO m, IsCheckButton o) => o -> m Bool
- setCheckButtonInconsistent :: (MonadIO m, IsCheckButton o) => o -> Bool -> m ()
- clearCheckButtonLabel :: (MonadIO m, IsCheckButton o) => o -> m ()
- constructCheckButtonLabel :: (IsCheckButton o, MonadIO m) => Text -> m (GValueConstruct o)
- getCheckButtonLabel :: (MonadIO m, IsCheckButton o) => o -> m (Maybe Text)
- setCheckButtonLabel :: (MonadIO m, IsCheckButton o) => o -> Text -> m ()
- constructCheckButtonUseUnderline :: (IsCheckButton o, MonadIO m) => Bool -> m (GValueConstruct o)
- getCheckButtonUseUnderline :: (MonadIO m, IsCheckButton o) => o -> m Bool
- setCheckButtonUseUnderline :: (MonadIO m, IsCheckButton o) => o -> Bool -> m ()
- type C_CheckButtonToggledCallback = Ptr () -> Ptr () -> IO ()
- type CheckButtonToggledCallback = IO ()
- afterCheckButtonToggled :: (IsCheckButton a, MonadIO m) => a -> CheckButtonToggledCallback -> m SignalHandlerId
- genClosure_CheckButtonToggled :: MonadIO m => CheckButtonToggledCallback -> m (GClosure C_CheckButtonToggledCallback)
- mk_CheckButtonToggledCallback :: C_CheckButtonToggledCallback -> IO (FunPtr C_CheckButtonToggledCallback)
- noCheckButtonToggledCallback :: Maybe CheckButtonToggledCallback
- onCheckButtonToggled :: (IsCheckButton a, MonadIO m) => a -> CheckButtonToggledCallback -> m SignalHandlerId
- wrap_CheckButtonToggledCallback :: CheckButtonToggledCallback -> C_CheckButtonToggledCallback
Exported types
newtype CheckButton Source #
Memory-managed wrapper type.
Constructors
| CheckButton (ManagedPtr CheckButton) | 
Instances
| Eq CheckButton Source # | |
| Defined in GI.Gtk.Objects.CheckButton | |
| GObject CheckButton Source # | |
| Defined in GI.Gtk.Objects.CheckButton | |
| ManagedPtrNewtype CheckButton Source # | |
| Defined in GI.Gtk.Objects.CheckButton Methods toManagedPtr :: CheckButton -> ManagedPtr CheckButton | |
| TypedObject CheckButton Source # | |
| Defined in GI.Gtk.Objects.CheckButton | |
| HasParentTypes CheckButton Source # | |
| Defined in GI.Gtk.Objects.CheckButton | |
| IsGValue (Maybe CheckButton) Source # | Convert  | 
| 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 # | |
| Defined in GI.Gtk.Objects.CheckButton type ParentTypes CheckButton = '[Widget, Object, Accessible, Actionable, Buildable, ConstraintTarget] | |
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
| (GObject o, IsDescendantOf CheckButton o) => IsCheckButton o Source # | |
| 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
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
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a) | |
| => a | 
 | 
| -> m Bool | Returns: The value of the  | 
Returns the current value of the CheckButton:active property.
getInconsistent
checkButtonGetInconsistent Source #
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a) | |
| => a | 
 | 
| -> m Bool | Returns:  | 
Returns whether the check button is in an inconsistent state.
getLabel
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a) | |
| => a | 
 | 
| -> m (Maybe Text) | Returns: The label  | 
Returns the label of the checkbutton.
getUseUnderline
checkButtonGetUseUnderline Source #
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a) | |
| => a | 
 | 
| -> m Bool | Returns: The value of the  | 
Returns the current value of the CheckButton:use-underline property.
new
Arguments
| :: (HasCallStack, MonadIO m) | |
| => m CheckButton | Returns: a  | 
Creates a new CheckButton.
newWithLabel
checkButtonNewWithLabel Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Maybe Text | 
 | 
| -> m CheckButton | Returns: a new  | 
Creates a new CheckButton with a Label next to it, if
 label is non-Nothing.
newWithMnemonic
checkButtonNewWithMnemonic Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Maybe Text | 
 | 
| -> m CheckButton | Returns: a new  | 
Creates a new CheckButton containing a label. Underscores
 in label indicate the mnemonic for the check button.
setActive
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a) | |
| => a | 
 | 
| -> Bool | 
 | 
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a, IsCheckButton b) | |
| => a | 
 | 
| -> Maybe b | 
 | 
| -> 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 | 
 | 
| -> Bool | 
 | 
| -> 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
Arguments
| :: (HasCallStack, MonadIO m, IsCheckButton a) | |
| => a | 
 | 
| -> Maybe 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 | 
 | 
| -> Bool | 
 | 
| -> 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
setcheckButton [ #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
setcheckButton [ #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
setcheckButton [ #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
setcheckButton [ #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
setcheckButton [ #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
genClosure_CheckButtonToggled :: MonadIO m => CheckButtonToggledCallback -> m (GClosure C_CheckButtonToggledCallback) Source #
Wrap the callback into a GClosure.
mk_CheckButtonToggledCallback :: C_CheckButtonToggledCallback -> IO (FunPtr C_CheckButtonToggledCallback) Source #
Generate a function pointer callable from C code, from a C_CheckButtonToggledCallback.
noCheckButtonToggledCallback :: Maybe CheckButtonToggledCallback Source #
A convenience synonym for Nothing :: Maybe CheckButtonToggledCallback
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