gi-gtk-4.0.8: 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.ShortcutAction

Description

GtkShortcutAction encodes an action that can be triggered by a keyboard shortcut.

GtkShortcutActions contain functions that allow easy presentation to end users as well as being printed for debugging.

All GtkShortcutActions are immutable, you can only specify their properties during construction. If you want to change a action, you have to replace it with a new one. If you need to pass arguments to an action, these are specified by the higher-level GtkShortcut object.

To activate a GtkShortcutAction manually, shortcutActionActivate can be called.

GTK provides various actions:

Synopsis

Exported types

newtype ShortcutAction Source #

Memory-managed wrapper type.

Constructors

ShortcutAction (ManagedPtr ShortcutAction) 

Instances

Instances details
Eq ShortcutAction Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

GObject ShortcutAction Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

ManagedPtrNewtype ShortcutAction Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

TypedObject ShortcutAction Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

Methods

glibType :: IO GType

HasParentTypes ShortcutAction Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

IsGValue (Maybe ShortcutAction) Source #

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

Instance details

Defined in GI.Gtk.Objects.ShortcutAction

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes ShortcutAction Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

type ParentTypes ShortcutAction = '[Object]

class (GObject o, IsDescendantOf ShortcutAction o) => IsShortcutAction o Source #

Type class for types which can be safely cast to ShortcutAction, for instance with toShortcutAction.

Instances

Instances details
(GObject o, IsDescendantOf ShortcutAction o) => IsShortcutAction o Source # 
Instance details

Defined in GI.Gtk.Objects.ShortcutAction

toShortcutAction :: (MonadIO m, IsShortcutAction o) => o -> m ShortcutAction Source #

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

Methods

activate

shortcutActionActivate Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutAction a, IsWidget b) 
=> a

self: a GtkShortcutAction

-> [ShortcutActionFlags]

flags: flags to activate with

-> b

widget: Target of the activation

-> Maybe GVariant

args: arguments to pass

-> m Bool

Returns: True if this action was activated successfully

Activates the action on the widget with the given args.

Note that some actions ignore the passed in flags, widget or args.

Activation of an action can fail for various reasons. If the action is not supported by the widget, if the args don't match the action or if the activation otherwise had no effect, False will be returned.

parseString

shortcutActionParseString Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Text

string: the string to parse

-> m (Maybe ShortcutAction)

Returns: a new GtkShortcutAction

Tries to parse the given string into an action.

On success, the parsed action is returned. When parsing failed, Nothing is returned.

The accepted strings are:

  • nothing, for GtkNothingAction
  • activate, for GtkActivateAction
  • mnemonic-activate, for GtkMnemonicAction
  • action(NAME), for a GtkNamedAction for the action named NAME
  • signal(NAME), for a GtkSignalAction for the signal NAME

print

shortcutActionPrint Source #

Arguments

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

self: a GtkShortcutAction

-> String

string: a GString to print into

-> m () 

Prints the given action into a string for the developer.

This is meant for debugging and logging.

The form of the representation may change at any time and is not guaranteed to stay identical.

toString

shortcutActionToString Source #

Arguments

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

self: a GtkShortcutAction

-> m Text

Returns: a new string

Prints the given action into a human-readable string.

This is a small wrapper around shortcutActionPrint to help when debugging.