gi-gio-2.0.14: Gio 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.Gio.Objects.SimpleAction

Contents

Description

A SimpleAction is the obvious simple implementation of the Action interface. This is the easiest way to create an action for purposes of adding it to a SimpleActionGroup.

See also GtkAction.

Synopsis

Exported types

Methods

new

simpleActionNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the action

-> Maybe VariantType

parameterType: the type of parameter to the activate function

-> m SimpleAction

Returns: a new SimpleAction

Creates a new action.

The created action is stateless. See simpleActionNewStateful.

Since: 2.28

newStateful

simpleActionNewStateful Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: the name of the action

-> Maybe VariantType

parameterType: the type of the parameter to the activate function

-> GVariant

state: the initial state of the action

-> m SimpleAction

Returns: a new SimpleAction

Creates a new stateful action.

state is the initial state of the action. All future state values must have the same VariantType as the initial state.

If the state GVariant is floating, it is consumed.

Since: 2.28

setEnabled

simpleActionSetEnabled Source #

Arguments

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

simple: a SimpleAction

-> Bool

enabled: whether the action is enabled

-> m () 

Sets the action as enabled or not.

An action must be enabled in order to be activated or in order to have its state changed from outside callers.

This should only be called by the implementor of the action. Users of the action should not attempt to modify its enabled flag.

Since: 2.28

setState

simpleActionSetState Source #

Arguments

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

simple: a SimpleAction

-> GVariant

value: the new GVariant for the state

-> m () 

Sets the state of the action.

This directly updates the 'state' property to the given value.

This should only be called by the implementor of the action. Users of the action should not attempt to directly modify the 'state' property. Instead, they should call actionChangeState to request the change.

If the value GVariant is floating, it is consumed.

Since: 2.30

setStateHint

simpleActionSetStateHint Source #

Arguments

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

simple: a SimpleAction

-> Maybe GVariant

stateHint: a GVariant representing the state hint

-> m () 

Sets the state hint for the action.

See actionGetStateHint for more information about action state hints.

Since: 2.44

Properties

enabled

name

parameterType

state

stateType

Signals

activate

changeState