Gnome::Gtk4::AlternativeTrigger
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Description
A Gnome::Gtk4::ShortcutTrigger that combines two triggers. The Gnome::Gtk4::AlternativeTrigger triggers when either of two trigger. This can be cascaded to combine more than two triggers.
Uml Diagram
Example
Two examples to set a Gnome::Gtk4::AlternativeTrigger object. The first example uses the the constructor of this class, the second uses the parser method of its parent class Gnome::Gtk4::ShortcutTrigger.
my Gnome::Gtk4::ShortcutTrigger $first .= parse-string('<CTRL>F5');
my Gnome::Gtk4::ShortcutTrigger $second .= parse-string('<ALT>A');
my Gnome::Gtk4::AlternativeTrigger $alternativetrigger .=
new-alternativetrigger( $first, $second);
my Gnome::Gtk4::AlternativeTrigger $alternativetrigger .=
parse-string('<CTRL>F5|<SHIFT>8');
=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-alternativetrigger
Creates a Gnome::Gtk4::ShortcutTrigger that will trigger whenever either of the two given triggers gets triggered.
Note that nesting is allowed, so if you want more than two alternatives, create a new alternative trigger for each option.
method new-alternativetrigger (
N-Object() $first, N-Object() $second
--> Gnome::Gtk4::AlternativeTrigger
)
$first; (transfer ownership: full) The first trigger that may trigger.
$second; (transfer ownership: full) The second trigger that may trigger.
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-first
Gets the first of the two alternative triggers that may trigger this object.
.get-second() will return the other one.
method get-first ( --> N-Object )
Return value; the first alternative trigger.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-second
Gets the second of the two alternative triggers that may trigger this object.
.get-first() will return the other one.
method get-second ( --> N-Object )
Return value; the second alternative trigger.
=end rakudoc