gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.Switch

Contents

Description

Switch is a widget that has two states: on or off. The user can control which state should be active by clicking the empty area, or by dragging the handle.

GtkSwitch can also handle situations where the underlying state changes with a delay. See Switch::state-set for details.

CSS nodes

plain code

switch
╰── slider

GtkSwitch has two css nodes, the main node with the name switch and a subnode named slider. Neither of them is using any style classes.

Synopsis

Exported types

Methods

getActive

data SwitchGetActiveMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsSwitch a) => MethodInfo * SwitchGetActiveMethodInfo a signature Source # 

switchGetActive Source #

Arguments

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

sw: a Switch

-> m Bool

Returns: True if the Switch is active, and False otherwise

Gets whether the Switch is in its “on” or “off” state.

Since: 3.0

getState

data SwitchGetStateMethodInfo Source #

Instances

((~) * signature (m Bool), MonadIO m, IsSwitch a) => MethodInfo * SwitchGetStateMethodInfo a signature Source # 

switchGetState Source #

Arguments

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

sw: a Switch

-> m Bool

Returns: the underlying state

Gets the underlying state of the Switch.

Since: 3.14

new

switchNew Source #

Arguments

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

Returns: the newly created Switch instance

Creates a new Switch widget.

Since: 3.0

setActive

data SwitchSetActiveMethodInfo Source #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsSwitch a) => MethodInfo * SwitchSetActiveMethodInfo a signature Source # 

switchSetActive Source #

Arguments

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

sw: a Switch

-> Bool

isActive: True if sw should be active, and False otherwise

-> m () 

Changes the state of sw to the desired one.

Since: 3.0

setState

data SwitchSetStateMethodInfo Source #

Instances

((~) * signature (Bool -> m ()), MonadIO m, IsSwitch a) => MethodInfo * SwitchSetStateMethodInfo a signature Source # 

switchSetState Source #

Arguments

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

sw: a Switch

-> Bool

state: the new state

-> m () 

Sets the underlying state of the Switch.

Normally, this is the same as Switch:active, unless the switch is set up for delayed state changes. This function is typically called from a Switch::state-set signal handler.

See Switch::state-set for details.

Since: 3.14

Properties

active

data SwitchActivePropertyInfo Source #

Instances

AttrInfo SwitchActivePropertyInfo Source # 
type AttrOrigin SwitchActivePropertyInfo Source # 
type AttrLabel SwitchActivePropertyInfo Source # 
type AttrGetType SwitchActivePropertyInfo Source # 
type AttrBaseTypeConstraint SwitchActivePropertyInfo Source # 
type AttrSetTypeConstraint SwitchActivePropertyInfo Source # 
type AttrAllowedOps SwitchActivePropertyInfo Source # 

setSwitchActive :: (MonadIO m, IsSwitch o) => o -> Bool -> m () Source #

state

data SwitchStatePropertyInfo Source #

Instances

AttrInfo SwitchStatePropertyInfo Source # 
type AttrOrigin SwitchStatePropertyInfo Source # 
type AttrLabel SwitchStatePropertyInfo Source # 
type AttrGetType SwitchStatePropertyInfo Source # 
type AttrBaseTypeConstraint SwitchStatePropertyInfo Source # 
type AttrSetTypeConstraint SwitchStatePropertyInfo Source # 
type AttrAllowedOps SwitchStatePropertyInfo Source # 

setSwitchState :: (MonadIO m, IsSwitch o) => o -> Bool -> m () Source #

Signals

activate

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

stateSet