gi-gtk-3.0.41: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.ToggleAction

Description

A ToggleAction corresponds roughly to a CheckMenuItem. It has an “active” state specifying whether the action has been checked or not.

Synopsis

Exported types

newtype ToggleAction Source #

Memory-managed wrapper type.

Constructors

ToggleAction (ManagedPtr ToggleAction) 

Instances

Instances details
Eq ToggleAction Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

GObject ToggleAction Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

ManagedPtrNewtype ToggleAction Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

Methods

toManagedPtr :: ToggleAction -> ManagedPtr ToggleAction

TypedObject ToggleAction Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

Methods

glibType :: IO GType

HasParentTypes ToggleAction Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

IsGValue (Maybe ToggleAction) Source #

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

Instance details

Defined in GI.Gtk.Objects.ToggleAction

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe ToggleAction -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe ToggleAction)

type ParentTypes ToggleAction Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

type ParentTypes ToggleAction = '[Action, Object, Buildable]

class (GObject o, IsDescendantOf ToggleAction o) => IsToggleAction o Source #

Type class for types which can be safely cast to ToggleAction, for instance with toToggleAction.

Instances

Instances details
(GObject o, IsDescendantOf ToggleAction o) => IsToggleAction o Source # 
Instance details

Defined in GI.Gtk.Objects.ToggleAction

toToggleAction :: (MonadIO m, IsToggleAction o) => o -> m ToggleAction Source #

Cast to ToggleAction, for types for which this is known to be safe. For general casts, use castTo.

Methods

getActive

toggleActionGetActive Source #

Arguments

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

action: the action object

-> m Bool

Returns: the checked state of the toggle action

Deprecated: (Since version 3.10)

Returns the checked state of the toggle action.

Since: 2.4

getDrawAsRadio

toggleActionGetDrawAsRadio Source #

Arguments

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

action: the action object

-> m Bool

Returns: whether the action should have proxies like a radio action.

Deprecated: (Since version 3.10)

Returns whether the action should have proxies like a radio action.

Since: 2.4

new

toggleActionNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

name: A unique name for the action

-> Maybe Text

label: The label displayed in menu items and on buttons, or Nothing

-> Maybe Text

tooltip: A tooltip for the action, or Nothing

-> Maybe Text

stockId: The stock icon to display in widgets representing the action, or Nothing

-> m ToggleAction

Returns: a new ToggleAction

Deprecated: (Since version 3.10)

Creates a new ToggleAction object. To add the action to a ActionGroup and set the accelerator for the action, call actionGroupAddActionWithAccel.

Since: 2.4

setActive

toggleActionSetActive Source #

Arguments

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

action: the action object

-> Bool

isActive: whether the action should be checked or not

-> m () 

Deprecated: (Since version 3.10)

Sets the checked state on the toggle action.

Since: 2.4

setDrawAsRadio

toggleActionSetDrawAsRadio Source #

Arguments

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

action: the action object

-> Bool

drawAsRadio: whether the action should have proxies like a radio action

-> m () 

Deprecated: (Since version 3.10)

Sets whether the action should have proxies like a radio action.

Since: 2.4

toggled

toggleActionToggled Source #

Arguments

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

action: the action object

-> m () 

Deprecated: (Since version 3.10)

Emits the “toggled” signal on the toggle action.

Since: 2.4

Properties

active

Whether the toggle action should be active.

Since: 2.10

constructToggleActionActive :: (IsToggleAction 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.

getToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> m Bool Source #

Get the value of the “active” property. When overloading is enabled, this is equivalent to

get toggleAction #active

setToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> Bool -> m () Source #

Set the value of the “active” property. When overloading is enabled, this is equivalent to

set toggleAction [ #active := value ]

drawAsRadio

Whether the proxies for this action look like radio action proxies.

This is an appearance property and thus only applies if Activatable:use-action-appearance is True.

constructToggleActionDrawAsRadio :: (IsToggleAction o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “draw-as-radio” property. This is rarely needed directly, but it is used by new.

getToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> m Bool Source #

Get the value of the “draw-as-radio” property. When overloading is enabled, this is equivalent to

get toggleAction #drawAsRadio

setToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> Bool -> m () Source #

Set the value of the “draw-as-radio” property. When overloading is enabled, this is equivalent to

set toggleAction [ #drawAsRadio := value ]

Signals

toggled

type ToggleActionToggledCallback = IO () Source #

Deprecated: (Since version 3.10)

Should be connected if you wish to perform an action whenever the ToggleAction state is changed.

afterToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ((?self :: a) => ToggleActionToggledCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggled signal, to be run after the default handler. When overloading is enabled, this is equivalent to

after toggleAction #toggled callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit ?self parameter. Note that this requires activating the ImplicitParams GHC extension.

onToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ((?self :: a) => ToggleActionToggledCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggled signal, to be run before the default handler. When overloading is enabled, this is equivalent to

on toggleAction #toggled callback