| 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.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:
MnemonicAction: a shortcut action that callswidgetMnemonicActivateCallbackAction: a shortcut action that invokes a given callbackSignalAction: a shortcut action that emits a given signalActivateAction: a shortcut action that callswidgetActivateNamedAction: a shortcut action that callsgtk_widget_activate_action()NothingAction: a shortcut action that does nothing
Synopsis
- newtype ShortcutAction = ShortcutAction (ManagedPtr ShortcutAction)
- class (GObject o, IsDescendantOf ShortcutAction o) => IsShortcutAction o
- toShortcutAction :: (MonadIO m, IsShortcutAction o) => o -> m ShortcutAction
- shortcutActionActivate :: (HasCallStack, MonadIO m, IsShortcutAction a, IsWidget b) => a -> [ShortcutActionFlags] -> b -> Maybe GVariant -> m Bool
- shortcutActionParseString :: (HasCallStack, MonadIO m) => Text -> m (Maybe ShortcutAction)
- shortcutActionPrint :: (HasCallStack, MonadIO m, IsShortcutAction a) => a -> String -> m ()
- shortcutActionToString :: (HasCallStack, MonadIO m, IsShortcutAction a) => a -> m Text
Exported types
newtype ShortcutAction Source #
Memory-managed wrapper type.
Constructors
| ShortcutAction (ManagedPtr ShortcutAction) |
Instances
| Eq ShortcutAction Source # | |
Defined in GI.Gtk.Objects.ShortcutAction Methods (==) :: ShortcutAction -> ShortcutAction -> Bool # (/=) :: ShortcutAction -> ShortcutAction -> Bool # | |
| GObject ShortcutAction Source # | |
Defined in GI.Gtk.Objects.ShortcutAction | |
| ManagedPtrNewtype ShortcutAction Source # | |
Defined in GI.Gtk.Objects.ShortcutAction Methods toManagedPtr :: ShortcutAction -> ManagedPtr ShortcutAction # | |
| TypedObject ShortcutAction Source # | |
Defined in GI.Gtk.Objects.ShortcutAction | |
| HasParentTypes ShortcutAction Source # | |
Defined in GI.Gtk.Objects.ShortcutAction | |
| IsGValue (Maybe ShortcutAction) Source # | Convert |
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 # | |
Defined in GI.Gtk.Objects.ShortcutAction | |
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
| (GObject o, IsDescendantOf ShortcutAction o) => IsShortcutAction o Source # | |
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
Click to display all available methods, including inherited ones
Methods
activate, bindProperty, bindPropertyFull, forceFloating, freezeNotify, getv, isFloating, notify, notifyByPspec, print, ref, refSink, runDispose, stealData, stealQdata, thawNotify, toString, unref, watchClosure.
Getters
getData, getProperty, getQdata.
Setters
activate
shortcutActionActivate Source #
Arguments
| :: (HasCallStack, MonadIO m, IsShortcutAction a, IsWidget b) | |
| => a |
|
| -> [ShortcutActionFlags] |
|
| -> b |
|
| -> Maybe GVariant |
|
| -> m Bool | Returns: |
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 |
|
| -> m (Maybe ShortcutAction) | Returns: a new |
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, forGtkNothingActionactivate, forGtkActivateActionmnemonic-activate, forGtkMnemonicActionaction(NAME), for aGtkNamedActionfor the action namedNAMEsignal(NAME), for aGtkSignalActionfor the signalNAME
Arguments
| :: (HasCallStack, MonadIO m, IsShortcutAction a) | |
| => a |
|
| -> String |
|
| -> 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 |
|
| -> 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.