Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Adw.Objects.SwitchRow
Description
A ListBoxRow
used to represent two states.
<picture> <source srcset="switch-row-dark.png" media="(prefers-color-scheme: dark)"> <img src="switch-row.png" alt="switch-row"> </picture>
The AdwSwitchRow
widget contains a Switch
that allows the user
to select between two states: "on" or "off". When activated, the row will
invert its active state.
The user can control the switch by activating the row or by dragging on the switch handle.
See Switch
for details.
Example of an AdwSwitchRow
UI definition:
xml code
<object class="AdwSwitchRow"> <property name="title" translatable="yes">Switch Row</property> <signal name="notify::active" handler="switch_row_notify_active_cb"/> </object>
The [propertyswitchRow
:active] property should be connected to in order to
monitor changes to the active state.
Since: 1.4
Synopsis
- newtype SwitchRow = SwitchRow (ManagedPtr SwitchRow)
- class (GObject o, IsDescendantOf SwitchRow o) => IsSwitchRow o
- toSwitchRow :: (MonadIO m, IsSwitchRow o) => o -> m SwitchRow
- switchRowGetActive :: (HasCallStack, MonadIO m, IsSwitchRow a) => a -> m Bool
- switchRowNew :: (HasCallStack, MonadIO m) => m SwitchRow
- switchRowSetActive :: (HasCallStack, MonadIO m, IsSwitchRow a) => a -> Bool -> m ()
- constructSwitchRowActive :: (IsSwitchRow o, MonadIO m) => Bool -> m (GValueConstruct o)
- getSwitchRowActive :: (MonadIO m, IsSwitchRow o) => o -> m Bool
- setSwitchRowActive :: (MonadIO m, IsSwitchRow o) => o -> Bool -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq SwitchRow Source # | |
GObject SwitchRow Source # | |
Defined in GI.Adw.Objects.SwitchRow | |
ManagedPtrNewtype SwitchRow Source # | |
Defined in GI.Adw.Objects.SwitchRow Methods toManagedPtr :: SwitchRow -> ManagedPtr SwitchRow | |
TypedObject SwitchRow Source # | |
Defined in GI.Adw.Objects.SwitchRow | |
HasParentTypes SwitchRow Source # | |
Defined in GI.Adw.Objects.SwitchRow | |
IsGValue (Maybe SwitchRow) Source # | Convert |
Defined in GI.Adw.Objects.SwitchRow Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe SwitchRow -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe SwitchRow) | |
type ParentTypes SwitchRow Source # | |
Defined in GI.Adw.Objects.SwitchRow type ParentTypes SwitchRow = '[ActionRow, PreferencesRow, ListBoxRow, Widget, Object, Accessible, Actionable, Buildable, ConstraintTarget] |
class (GObject o, IsDescendantOf SwitchRow o) => IsSwitchRow o Source #
Type class for types which can be safely cast to SwitchRow
, for instance with toSwitchRow
.
Instances
(GObject o, IsDescendantOf SwitchRow o) => IsSwitchRow o Source # | |
Defined in GI.Adw.Objects.SwitchRow |
toSwitchRow :: (MonadIO m, IsSwitchRow o) => o -> m SwitchRow Source #
Methods
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addPrefix, addSuffix, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, changed, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSelected, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getActionName, getActionTargetValue, getActivatable, getActivatableWidget, getActive, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeader, getHeight, getHexpand, getHexpandSet, getIconName, getIndex, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSelectable, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSubtitle, getSubtitleLines, getSubtitleSelectable, getTemplateChild, getTitle, getTitleLines, getTitleSelectable, getTooltipMarkup, getTooltipText, getUseMarkup, getUseUnderline, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setActionName, setActionTargetValue, setActivatable, setActivatableWidget, setActive, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDetailedActionName, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHeader, setHexpand, setHexpandSet, setIconName, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSelectable, setSensitive, setSizeRequest, setStateFlags, setSubtitle, setSubtitleLines, setSubtitleSelectable, setTitle, setTitleLines, setTitleSelectable, setTooltipMarkup, setTooltipText, setUseMarkup, setUseUnderline, setValign, setVexpand, setVexpandSet, setVisible.
getActive
Arguments
:: (HasCallStack, MonadIO m, IsSwitchRow a) | |
=> a |
|
-> m Bool | Returns: whether |
Gets whether self
is in its "on" or "off" position.
Since: 1.4
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m SwitchRow | Returns: the newly created |
Creates a new AdwSwitchRow
.
Since: 1.4
setActive
Arguments
:: (HasCallStack, MonadIO m, IsSwitchRow a) | |
=> a |
|
-> Bool |
|
-> m () |
Sets whether self
is in its "on" or "off" position
Since: 1.4
Properties
active
Whether the switch row is in the "on" or "off" position.
Since: 1.4
constructSwitchRowActive :: (IsSwitchRow 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
.
getSwitchRowActive :: (MonadIO m, IsSwitchRow o) => o -> m Bool Source #
Get the value of the “active
” property.
When overloading is enabled, this is equivalent to
get
switchRow #active
setSwitchRowActive :: (MonadIO m, IsSwitchRow o) => o -> Bool -> m () Source #
Set the value of the “active
” property.
When overloading is enabled, this is equivalent to
set
switchRow [ #active:=
value ]