gi-adwaita-1.0.7: Adwaita bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

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

Exported types

newtype SwitchRow Source #

Memory-managed wrapper type.

Constructors

SwitchRow (ManagedPtr SwitchRow) 

Instances

Instances details
Eq SwitchRow Source # 
Instance details

Defined in GI.Adw.Objects.SwitchRow

GObject SwitchRow Source # 
Instance details

Defined in GI.Adw.Objects.SwitchRow

ManagedPtrNewtype SwitchRow Source # 
Instance details

Defined in GI.Adw.Objects.SwitchRow

Methods

toManagedPtr :: SwitchRow -> ManagedPtr SwitchRow

TypedObject SwitchRow Source # 
Instance details

Defined in GI.Adw.Objects.SwitchRow

Methods

glibType :: IO GType

HasParentTypes SwitchRow Source # 
Instance details

Defined in GI.Adw.Objects.SwitchRow

IsGValue (Maybe SwitchRow) Source #

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

Instance details

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 # 
Instance details

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

Instances details
(GObject o, IsDescendantOf SwitchRow o) => IsSwitchRow o Source # 
Instance details

Defined in GI.Adw.Objects.SwitchRow

toSwitchRow :: (MonadIO m, IsSwitchRow o) => o -> m SwitchRow Source #

Cast to SwitchRow, 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, 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

switchRowGetActive Source #

Arguments

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

self: a switch row

-> m Bool

Returns: whether self is active or not

Gets whether self is in its "on" or "off" position.

Since: 1.4

new

switchRowNew Source #

Arguments

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

Returns: the newly created AdwSwitchRow

Creates a new AdwSwitchRow.

Since: 1.4

setActive

switchRowSetActive Source #

Arguments

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

self: a switch row

-> Bool

isActive: whether self should be active

-> 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 ]