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.SignalAction

Contents

- Exported types
- Methods
  - getSignalName
  - new
- Properties
  - signalName

Description

Emits a signal on a widget.

Signals that are used in this way are referred to as keybinding signals, and they are expected to be defined with the `G_SIGNAL_ACTION` flag.

Synopsis

- newtype SignalAction = SignalAction (ManagedPtr SignalAction)
- class (GObject o, IsDescendantOf SignalAction o) => IsSignalAction o
- toSignalAction :: (MonadIO m, IsSignalAction o) => o -> m SignalAction
- signalActionGetSignalName :: (HasCallStack, MonadIO m, IsSignalAction a) => a -> m Text
- signalActionNew :: (HasCallStack, MonadIO m) => Text -> m SignalAction
- constructSignalActionSignalName :: (IsSignalAction o, MonadIO m) => Text -> m (GValueConstruct o)
- getSignalActionSignalName :: (MonadIO m, IsSignalAction o) => o -> m Text

# Exported types

newtype SignalAction Source #

Memory-managed wrapper type.

Constructors

SignalAction (ManagedPtr SignalAction) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf SignalAction o) => IsSignalAction o Source #

Type class for types which can be safely cast to `SignalAction`, for instance with `toSignalAction`.

#### Instances

Instances details

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

toSignalAction :: (MonadIO m, IsSignalAction o) => o -> m SignalAction Source #

Cast to `SignalAction`, 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

getData, getProperty, getQdata, getSignalName.

#### Setters

setData, setDataFull, setProperty.

## getSignalName

signalActionGetSignalName Source #

Arguments

:: (HasCallStack, MonadIO m, IsSignalAction a) |
=> a | `self`: a signal action
-> m Text | Returns: the name of the signal to emit

Returns the name of the signal that will be emitted.

## new

signalActionNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Text | `signalName`: name of the signal to emit
-> m SignalAction | Returns: a new `GtkShortcutAction`

Creates an action that when activated, emits the given action signal on the provided widget.

It will also unpack the args into arguments passed to the signal.

# Properties

## signalName

The name of the signal to emit.

constructSignalActionSignalName :: (IsSignalAction o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getSignalActionSignalName :: (MonadIO m, IsSignalAction o) => o -> m Text Source #

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

    get signalAction #signalName