gi-gtk-4.0.6: 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.Shortcut

Description

A GtkShortcut describes a keyboard shortcut.

It contains a description of how to trigger the shortcut via a ShortcutTrigger and a way to activate the shortcut on a widget via a ShortcutAction.

The actual work is usually done via ShortcutController, which decides if and when to activate a shortcut. Using that controller directly however is rarely necessary as various higher level convenience APIs exist on GtkWidgets that make it easier to use shortcuts in GTK.

GtkShortcut does provide functionality to make it easy for users to work with shortcuts, either by providing informational strings for display purposes or by allowing shortcuts to be configured.

Synopsis

Exported types

newtype Shortcut Source #

Memory-managed wrapper type.

Constructors

Shortcut (ManagedPtr Shortcut) 

Instances

Instances details
Eq Shortcut Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

GObject Shortcut Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

ManagedPtrNewtype Shortcut Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

Methods

toManagedPtr :: Shortcut -> ManagedPtr Shortcut

TypedObject Shortcut Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

Methods

glibType :: IO GType

HasParentTypes Shortcut Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

IsGValue (Maybe Shortcut) Source #

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

Instance details

Defined in GI.Gtk.Objects.Shortcut

Methods

gvalueGType_ :: IO GType

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

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

type ParentTypes Shortcut Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

type ParentTypes Shortcut = '[Object]

class (GObject o, IsDescendantOf Shortcut o) => IsShortcut o Source #

Type class for types which can be safely cast to Shortcut, for instance with toShortcut.

Instances

Instances details
(GObject o, IsDescendantOf Shortcut o) => IsShortcut o Source # 
Instance details

Defined in GI.Gtk.Objects.Shortcut

toShortcut :: (MonadIO m, IsShortcut o) => o -> m Shortcut Source #

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

Methods

getAction

shortcutGetAction Source #

Arguments

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

self: a GtkShortcut

-> m (Maybe ShortcutAction)

Returns: the action

Gets the action that is activated by this shortcut.

getArguments

shortcutGetArguments Source #

Arguments

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

self: a GtkShortcut

-> m (Maybe GVariant)

Returns: the arguments

Gets the arguments that are passed when activating the shortcut.

getTrigger

shortcutGetTrigger Source #

Arguments

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

self: a GtkShortcut

-> m (Maybe ShortcutTrigger)

Returns: the trigger used

Gets the trigger used to trigger self.

new

shortcutNew Source #

Arguments

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

trigger: The trigger that will trigger the shortcut

-> Maybe b

action: The action that will be activated upon triggering

-> m Shortcut

Returns: a new GtkShortcut

Creates a new GtkShortcut that is triggered by trigger and then activates action.

setAction

shortcutSetAction Source #

Arguments

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

self: a GtkShortcut

-> Maybe b

action: The new action. If the action is Nothing, the nothing action will be used.

-> m () 

Sets the new action for self to be action.

setArguments

shortcutSetArguments Source #

Arguments

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

self: a GtkShortcut

-> Maybe GVariant

args: arguments to pass when activating self

-> m () 

Sets the arguments to pass when activating the shortcut.

setTrigger

shortcutSetTrigger Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcut a, IsShortcutTrigger b) 
=> a

self: a GtkShortcut

-> Maybe b

trigger: The new trigger. If the trigger is Nothing, the never trigger will be used.

-> m () 

Sets the new trigger for self to be trigger.

Properties

action

The action that gets activated by this shortcut.

clearShortcutAction :: (MonadIO m, IsShortcut o) => o -> m () Source #

Set the value of the “action” property to Nothing. When overloading is enabled, this is equivalent to

clear #action

constructShortcutAction :: (IsShortcut o, MonadIO m, IsShortcutAction a) => a -> m (GValueConstruct o) Source #

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

getShortcutAction :: (MonadIO m, IsShortcut o) => o -> m (Maybe ShortcutAction) Source #

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

get shortcut #action

setShortcutAction :: (MonadIO m, IsShortcut o, IsShortcutAction a) => o -> a -> m () Source #

Set the value of the “action” property. When overloading is enabled, this is equivalent to

set shortcut [ #action := value ]

arguments

Arguments passed to activation.

clearShortcutArguments :: (MonadIO m, IsShortcut o) => o -> m () Source #

Set the value of the “arguments” property to Nothing. When overloading is enabled, this is equivalent to

clear #arguments

constructShortcutArguments :: (IsShortcut o, MonadIO m) => GVariant -> m (GValueConstruct o) Source #

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

getShortcutArguments :: (MonadIO m, IsShortcut o) => o -> m (Maybe GVariant) Source #

Get the value of the “arguments” property. When overloading is enabled, this is equivalent to

get shortcut #arguments

setShortcutArguments :: (MonadIO m, IsShortcut o) => o -> GVariant -> m () Source #

Set the value of the “arguments” property. When overloading is enabled, this is equivalent to

set shortcut [ #arguments := value ]

trigger

The trigger that triggers this shortcut.

clearShortcutTrigger :: (MonadIO m, IsShortcut o) => o -> m () Source #

Set the value of the “trigger” property to Nothing. When overloading is enabled, this is equivalent to

clear #trigger

constructShortcutTrigger :: (IsShortcut o, MonadIO m, IsShortcutTrigger a) => a -> m (GValueConstruct o) Source #

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

getShortcutTrigger :: (MonadIO m, IsShortcut o) => o -> m (Maybe ShortcutTrigger) Source #

Get the value of the “trigger” property. When overloading is enabled, this is equivalent to

get shortcut #trigger

setShortcutTrigger :: (MonadIO m, IsShortcut o, IsShortcutTrigger a) => o -> a -> m () Source #

Set the value of the “trigger” property. When overloading is enabled, this is equivalent to

set shortcut [ #trigger := value ]