gi-gtk4-4.0.12: Gtk 4.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.NamedAction

Contents

- Exported types
- Methods
  - getActionName
  - new
- Properties
  - actionName

Description

Activates a named action.

See `widgetClassInstallAction` and `widgetInsertActionGroup` for ways to associate named actions with widgets.

Synopsis

- newtype NamedAction = NamedAction (ManagedPtr NamedAction)
- class (GObject o, IsDescendantOf NamedAction o) => IsNamedAction o
- toNamedAction :: (MonadIO m, IsNamedAction o) => o -> m NamedAction
- namedActionGetActionName :: (HasCallStack, MonadIO m, IsNamedAction a) => a -> m Text
- namedActionNew :: (HasCallStack, MonadIO m) => Text -> m NamedAction
- constructNamedActionActionName :: (IsNamedAction o, MonadIO m) => Text -> m (GValueConstruct o)
- getNamedActionActionName :: (MonadIO m, IsNamedAction o) => o -> m Text

# Exported types

newtype NamedAction Source #

Memory-managed wrapper type.

Constructors

NamedAction (ManagedPtr NamedAction) |

#### Instances

Instances details

Eq NamedAction Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction Methods (==) :: NamedAction -> NamedAction -> Bool Source # (/=) :: NamedAction -> NamedAction -> Bool Source #
GObject NamedAction Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction
ManagedPtrNewtype NamedAction Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction Methods toManagedPtr :: NamedAction -> ManagedPtr NamedAction Source #
TypedObject NamedAction Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction Methods glibType :: IO GType Source #
HasParentTypes NamedAction Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction
IsGValue (Maybe NamedAction) Source # | Convert `NamedAction` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.NamedAction Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe NamedAction -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe NamedAction) Source #
type ParentTypes NamedAction Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction type ParentTypes NamedAction = '[ShortcutAction, Object]

class (GObject o, IsDescendantOf NamedAction o) => IsNamedAction o Source #

Type class for types which can be safely cast to `NamedAction`, for instance with `toNamedAction`.

#### Instances

Instances details

(GObject o, IsDescendantOf NamedAction o) => IsNamedAction o Source # |
Instance details Defined in GI.Gtk.Objects.NamedAction

toNamedAction :: (MonadIO m, IsNamedAction o) => o -> m NamedAction Source #

Cast to `NamedAction`, 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, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, print, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toString, unref, watchClosure.

#### Getters

getActionName, getData, getProperty, getQdata.

#### Setters

setData, setDataFull, setProperty.

## getActionName

namedActionGetActionName Source #

Arguments

:: (HasCallStack, MonadIO m, IsNamedAction a) |
=> a | `self`: a named action
-> m Text | Returns: the name of the action to activate

Returns the name of the action that will be activated.

## new

namedActionNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `name`: the detailed name of the action
-> m NamedAction | Returns: a new `GtkShortcutAction`

Creates an action that when activated, activates the named action on the widget.

It also passes the given arguments to it.

See `widgetInsertActionGroup` for how to add actions to widgets.

# Properties

## actionName

The name of the action to activate.

constructNamedActionActionName :: (IsNamedAction o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getNamedActionActionName :: (MonadIO m, IsNamedAction o) => o -> m Text Source #

Get the value of the “`action-name`” property. When overloading is enabled, this is equivalent to

    get namedAction #actionName