1.87 <GtkGestureSingle>

Class: <GtkGestureSingle>

It derives from <GtkGesture>.

A <GtkGesture> subclass optimized for singe-touch and mouse gestures.

Under interaction, these gestures stick to the first interacting sequence, which is accessible through gesture-single:get-current-sequence while the gesture is being interacted with.

By default gestures react to both GDK_BUTTON_PRIMARY and touch events. gesture-single:set-touch-only can be used to change the touch behavior. Callers may also specify a different mouse button number to interact with through gesture-single:set-button, or react to any mouse button by setting it to 0. While the gesture is active, the button being currently pressed can be known through gesture-single:get-current-button.

Properties

Property: gesture-single:button self

Mouse button number to listen to, or 0 to listen for any button.

Its value is an unsigned 32-bit integer.

Set it with (set! (gesture-single:button self) value).

Property: gesture-single:exclusive self

Whether the gesture is exclusive.

Exclusive gestures only listen to pointer and pointer emulated events.

Its value is a boolean.

Set it with (set! (gesture-single:exclusive self) value).

Property: gesture-single:touch-only self

Whether the gesture handles only touch events.

Its value is a boolean.

Set it with (set! (gesture-single:touch-only self) value).

Procedures

Method: gesture-single:get-button self ⇒ %return
Method: get-button self ⇒ %return

Returns the button number self listens for.

If this is 0, the gesture reacts to any button press.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

%return

Returned: an unsigned 32-bit integer.

The button number, or 0 for any button

Method: gesture-single:get-current-button self ⇒ %return
Method: get-current-button self ⇒ %return

Returns the button number currently interacting with self, or 0 if there is none.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

%return

Returned: an unsigned 32-bit integer.

The current button number

Method: gesture-single:get-current-sequence self ⇒ %return
Method: get-current-sequence self ⇒ %return

Returns the event sequence currently interacting with self.

This is only meaningful if gesture:is-active? returns #t.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

%return

Returned: a <GdkEventSequence>, or #f.

the current sequence

Method: gesture-single:get-exclusive? self ⇒ %return
Method: get-exclusive? self ⇒ %return

Gets whether a gesture is exclusive.

For more information, see gesture-single:set-exclusive.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

%return

Returned: a boolean.

Whether the gesture is exclusive

Method: gesture-single:get-touch-only? self ⇒ %return
Method: get-touch-only? self ⇒ %return

Returns #t if the gesture is only triggered by touch events.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

%return

Returned: a boolean.

#t if the gesture only handles touch events

Method: gesture-single:set-button self button
Method: set-button self button

Sets the button number self listens to.

If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

button

Passed: an unsigned 32-bit integer.

button number to listen to, or 0 for any button

Method: gesture-single:set-exclusive self exclusive
Method: set-exclusive self exclusive

Sets whether self is exclusive.

An exclusive gesture will only handle pointer and "pointer emulated" touch events, so at any given time, there is only one sequence able to interact with those.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

exclusive

Passed: a boolean.

#t to make self exclusive

Method: gesture-single:set-touch-only self touch-only
Method: set-touch-only self touch-only

Sets whether to handle only touch events.

If touch-only is #t, self will only handle events of type touch-begin, touch-update or touch-end. If #f, mouse events will be handled too.

self

Passed: a <GtkGestureSingle>.

a <GtkGestureSingle>

touch-only

Passed: a boolean.

whether self handles only touch events