Gnome::Gtk4::Shortcut
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Description
A Gnome::Gtk4::Shortcut describes a keyboard shortcut.
It contains a description of how to trigger the shortcut via a Gnome::Gtk4::ShortcutTrigger and a way to activate the shortcut on a widget via a Gnome::Gtk4::ShortcutAction.
The actual work is usually done via Gnome::Gtk4::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 Gnome::Gtk4::Widgets that make it easier to use shortcuts in GTK.
Gnome::Gtk4::Shortcut 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.
Uml Diagram
=end rakudoc
#------------------------------------------------------------------------------- #--[Class Initialization]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Class initialization
new
:native-object
Create an object using a native object from an object of the same type found elsewhere. See also Gnome::N::TopLevelSupportClass.
multi method new ( N-Object() :$native-object! )
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-shortcut
Creates a new Gnome::Gtk4::Shortcut that is triggered by $trigger and then activates $action.
method new-shortcut ( N-Object() $trigger, N-Object() $action --> Gnome::Gtk4::Shortcut )
$trigger; (transfer ownership: full) The trigger that will trigger the shortcut.
$action; (transfer ownership: full) The action that will be activated upon triggering.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
new-with-arguments
Creates a new Gnome::Gtk4::Shortcut that is triggered by $trigger and then activates $action with arguments given by $format-string.
method new-with-arguments ( N-Object() $trigger, N-Object() $action, Str $format-string, β¦ --> Gnome::Gtk4::Shortcut )
$trigger; (transfer ownership: full) The trigger that will trigger the shortcut.
$action; (transfer ownership: full) The action that will be activated upon triggering.
$format-string; GVariant format string for arguments or undefined for no arguments.
β¦; β¦. Note that each argument must be specified as a type followed by its value!
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-action
Gets the action that is activated by this shortcut.
method get-action (--> N-Object )
Return value; the action.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-arguments
Gets the arguments that are passed when activating the shortcut.
method get-arguments (--> N-Object )
Return value; the arguments.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-trigger
Gets the trigger used to trigger $self.
method get-trigger (--> N-Object )
Return value; the trigger used.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-action
Sets the new action for $self to be $action.
method set-action ( N-Object() $action )
$action; (transfer ownership: full) The new action. If the
$actionis undefined, the nothing action will be used..
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-arguments
Sets the arguments to pass when activating the shortcut.
method set-arguments ( N-Object $args )
$args; arguments to pass when activating
$self
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-trigger
Sets the new trigger for $self to be $trigger.
method set-trigger ( N-Object() $trigger )
$trigger; (transfer ownership: full) The new trigger. If the
$triggeris undefined, the never trigger will be used..
=end rakudoc