gi-gio-2.0.11: 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

data SimpleActionEnabledPropertyInfo Source #

Instances

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

name

data SimpleActionNamePropertyInfo Source #

Instances

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

parameterType

data SimpleActionParameterTypePropertyInfo Source #

Instances

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

state

data SimpleActionStatePropertyInfo Source #

Instances

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

stateType

data SimpleActionStateTypePropertyInfo Source #

Instances

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

Signals

activate

changeState