About all my projects
Gnome::Gtk4::GestureClick

Gnome::Gtk4::GestureClick

Description

Gnome::Gtk4::GestureClick is a Gnome::Gtk4::Gesture implementation for clicks.

It is able to recognize multiple clicks on a nearby zone, which can be listened for through the pressed signal. Whenever time or distance between clicks exceed the GTK defaults, stopped is emitted, and the click counter is reset.

Uml Diagram

No caption

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! )

new-gestureclick

Returns a newly created Gnome::Gtk4::Gesture that recognizes single and multiple presses.

method new-gestureclick ( --> Gnome::Gtk4::GestureClick )

Signals

pressed

Emitted whenever a button or touch press happens.

method handler (
  gint $n-press,
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureClick :$_widget,
  *%user-options
)
  • $n-press; how many touch/button presses happened with this one.

  • $x; The X coordinate, in widget allocation coordinates.

  • $y; The Y coordinate, in widget allocation coordinates.

  • $_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::GestureClick object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.

released

Emitted when a button or touch is released. $n-press will report the number of press that is paired to this event, note that stopped may have been emitted between the press and its release, $n-press will only start over at the next press.

method handler (
  gint $n-press,
  gdouble $x,
  gdouble $y,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureClick :$_widget,
  *%user-options
)
  • $n-press; number of press that is paired with this release.

  • $x; The X coordinate, in widget allocation coordinates.

  • $y; The Y coordinate, in widget allocation coordinates.

  • $_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::GestureClick object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.

stopped

Emitted whenever any time/distance threshold has been exceeded.

method handler (
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureClick :$_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::GestureClick object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.

unpaired-release

Emitted whenever the gesture receives a release event that had no previous corresponding press.

Due to implicit grabs, this can only happen on situations where input is grabbed elsewhere mid-press or the pressed widget voluntarily relinquishes its implicit grab.

method handler (
  gdouble $x,
  gdouble $y,
  guint $button,
   $sequence,
  Int :$_handle_id,
  N-GObject :$_native-object,
  Gnome::Gtk4::GestureClick :$_widget,
  *%user-options
)
  • $x; X coordinate of the event.

  • $y; Y coordinate of the event.

  • $button; Button being released.

  • $sequence; Sequence being released.

  • $_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::GestureClick object.

  • %user-options; A list of named arguments provided by .register-signal() in class Object.