gi-gtk3-3.0.44: Gtk 3.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.ToggleAction

Contents

- Exported types
- Methods
  - getActive
  - getDrawAsRadio
  - new
  - setActive
  - setDrawAsRadio
  - toggled
- Properties
  - active
  - drawAsRadio
- Signals
  - toggled

Description

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

Synopsis

- newtype ToggleAction = ToggleAction (ManagedPtr ToggleAction)
- class (GObject o, IsDescendantOf ToggleAction o) => IsToggleAction o
- toToggleAction :: (MonadIO m, IsToggleAction o) => o -> m ToggleAction
- toggleActionGetActive :: (HasCallStack, MonadIO m, IsToggleAction a) => a -> m Bool
- toggleActionGetDrawAsRadio :: (HasCallStack, MonadIO m, IsToggleAction a) => a -> m Bool
- toggleActionNew :: (HasCallStack, MonadIO m) => Text -> Maybe Text -> Maybe Text -> Maybe Text -> m ToggleAction
- toggleActionSetActive :: (HasCallStack, MonadIO m, IsToggleAction a) => a -> Bool -> m ()
- toggleActionSetDrawAsRadio :: (HasCallStack, MonadIO m, IsToggleAction a) => a -> Bool -> m ()
- toggleActionToggled :: (HasCallStack, MonadIO m, IsToggleAction a) => a -> m ()
- constructToggleActionActive :: (IsToggleAction o, MonadIO m) => Bool -> m (GValueConstruct o)
- getToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> m Bool
- setToggleActionActive :: (MonadIO m, IsToggleAction o) => o -> Bool -> m ()
- constructToggleActionDrawAsRadio :: (IsToggleAction o, MonadIO m) => Bool -> m (GValueConstruct o)
- getToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> m Bool
- setToggleActionDrawAsRadio :: (MonadIO m, IsToggleAction o) => o -> Bool -> m ()
- type ToggleActionToggledCallback = IO ()
- afterToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ((?self :: a) => ToggleActionToggledCallback) -> m SignalHandlerId
- onToggleActionToggled :: (IsToggleAction a, MonadIO m) => a -> ((?self :: a) => ToggleActionToggledCallback) -> m SignalHandlerId

# 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 Methods (==) :: ToggleAction -> ToggleAction -> Bool Source # (/=) :: ToggleAction -> ToggleAction -> Bool Source #
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 Source #
TypedObject ToggleAction Source # |
Instance details Defined in GI.Gtk.Objects.ToggleAction Methods glibType :: IO GType Source #
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 Source # gvalueSet_ :: Ptr GValue -> Maybe ToggleAction -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ToggleAction) Source #
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

### Click to display all available methods, including inherited ones

Expand

#### Methods

activate, addChild, bindProperty, bindPropertyFull, blockActivate, connectAccelerator, constructChild, createIcon, createMenu, createMenuItem, createToolItem, customFinished, customTagEnd, customTagStart, disconnectAccelerator, forceFloating, freezeNotify, getv, isFloating, isSensitive, isVisible, notify, notifyByPspec, parserFinished, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toggled, unblockActivate, unref, watchClosure.

#### Getters

getAccelClosure, getAccelPath, getActive, getAlwaysShowImage, getData, getDrawAsRadio, getGicon, getIconName, getInternalChild, getIsImportant, getLabel, getName, getProperty, getProxies, getQdata, getSensitive, getShortLabel, getStockId, getTooltip, getVisible, getVisibleHorizontal, getVisibleVertical.

#### Setters

setAccelGroup, setAccelPath, setActive, setAlwaysShowImage, setBuildableProperty, setData, setDataFull, setDrawAsRadio, setGicon, setIconName, setIsImportant, setLabel, setName, setProperty, setSensitive, setShortLabel, setStockId, setTooltip, setVisible, setVisibleHorizontal, setVisibleVertical.

## 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:useActionAppearance 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