gi-gtk-3.0.17: 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

toSwitch :: (MonadIO m, IsSwitch o) => o -> m Switch Source #

Methods

getActive

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

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

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

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

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

state

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

Signals

activate

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

stateSet