Gnome::Gtk4::GestureLongPress
#------------------------------------------------------------------------------- #--[Class Description]---------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Description
Gnome::Gtk4::GestureLongPress is a Gnome::Gtk4::Gesture for long presses.
This gesture is also known as βPress and Holdβ.
When the timeout is exceeded, the gesture is triggering the pressed signal.
If the touchpoint is lifted before the timeout passes, or if it drifts too far of the initial press point, the cancelled signal will be emitted.
How long the timeout is before the pressed signal gets emitted is determined by the gtk-long-press-time defined in Gnome::Gtk4::Settings setting. It can be modified by the delay-factor property.
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-gesturelongpress
Returns a newly created Gnome::Gtk4::Gesture that recognizes long presses.
method new-gesturelongpress ( --> Gnome::Gtk4::GestureLongPress )
=end rakudoc
#------------------------------------------------------------------------------- #--[Methods]-------------------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Methods =end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
get-delay-factor
Returns the delay factor.
method get-delay-factor (--> Num )
Return value; the delay factor.
=end rakudoc
#------------------------------------------------------------------------------- =begin rakudoc
set-delay-factor
Applies the given delay factor.
The default long press time will be multiplied by this value. Valid values are in the range [0.5..2.0].
method set-delay-factor ( Num() $delay-factor )
$delay-factor; The delay factor to apply.
=end rakudoc
#------------------------------------------------------------------------------- #--[Signal Documentation]------------------------------------------------------- #-------------------------------------------------------------------------------
=begin rakudoc
Signals
cancelled
Emitted whenever a press moved too far, or was released before pressed happened.
method handler (
Int :$_handle_id,
N-GObject :$_native-object,
Gnome::Gtk4::GestureLongPress :$_widget,
*%user-options
)
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureLongPress object.
%user-options; A list of named arguments provided by .register-signal() in class Object.
pressed
Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.
method handler (
gdouble $x,
gdouble $y,
Int :$_handle_id,
N-GObject :$_native-object,
Gnome::Gtk4::GestureLongPress :$_widget,
*%user-options
)
$x; the X coordinate where the press happened, relative to the widget allocation.
$y; the Y coordinate where the press happened, relative to the widget allocation.
$_handle_id; The registered event handler id.
$_native-object; The native object provided by the Raku object which registered this event. This is a native Gnome::Gtk4::GestureLongPress object.
%user-options; A list of named arguments provided by .register-signal() in class Object.
=end rakudoc