Gtk.Gesture_Single

Entities

Tagged Types

Access Types

Constants

Subprograms

Description

Gtk.Gesture_Single.Gtk_Gesture_Single is a subclass of Gtk.Gesture.Gtk_Gesture, optimized (although not restricted) for dealing with mouse and single-touch gestures. Under interaction, these gestures stick to the first interacting sequence, which is accessible through Gtk.Gesture_Single.Get_Current_Sequence while the gesture is being interacted with.

By default gestures react to both GDK_BUTTON_PRIMARY and touch events, Gtk.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 Gtk.Gesture_Single.Set_Button, or react to any mouse button by setting 0. While the gesture is active, the button being currently pressed can be known through Gtk.Gesture_Single.Get_Current_Button.

Button_Property

Button_Property : constant Glib.Properties.Property_Uint;

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

Exclusive_Property

Exclusive_Property : constant Glib.Properties.Property_Boolean;

Whether the gesture is exclusive. Exclusive gestures only listen to pointer and pointer emulated events.

Get_Button

function Get_Button
   (Self : not null access Gtk_Gesture_Single_Record) return Guint

Returns the button number Gesture listens for, or 0 if Gesture reacts to any button press. Since: gtk+ 3.14

Parameters
Self
Return Value

The button number, or 0 for any button

Get_Current_Button

function Get_Current_Button
   (Self : not null access Gtk_Gesture_Single_Record) return Guint

Returns the button number currently interacting with Gesture, or 0 if there is none. Since: gtk+ 3.14

Parameters
Self
Return Value

The current button number

Get_Current_Sequence

function Get_Current_Sequence
   (Self : not null access Gtk_Gesture_Single_Record)
    return Gdk.Event.Gdk_Event_Sequence

Returns the event sequence currently interacting with Gesture. This is only meaningful if Gtk.Gesture.Is_Active returns True. Since: gtk+ 3.14

Parameters
Self
Return Value

the current sequence

Get_Exclusive

function Get_Exclusive
   (Self : not null access Gtk_Gesture_Single_Record) return Boolean

Gets whether a gesture is exclusive. For more information, see Gtk.Gesture_Single.Set_Exclusive. Since: gtk+ 3.14

Parameters
Self
Return Value

Whether the gesture is exclusive

Get_Touch_Only

function Get_Touch_Only
   (Self : not null access Gtk_Gesture_Single_Record) return Boolean

Returns True if the gesture is only triggered by touch events. Since: gtk+ 3.14

Parameters
Self
Return Value

True if the gesture only handles touch events

Get_Type

function Get_Type return Glib.GType
Return Value

Gtk_Gesture_Single

type Gtk_Gesture_Single is access all Gtk_Gesture_Single_Record'Class;

Gtk_Gesture_Single_Record

type Gtk_Gesture_Single_Record is new Gtk_Gesture_Record with null record;

Set_Button

procedure Set_Button
   (Self   : not null access Gtk_Gesture_Single_Record;
    Button : Guint)

Sets the button number Gesture listens to. If non-0, every button press from a different button number will be ignored. Touch events implicitly match with button 1. Since: gtk+ 3.14

Parameters
Self
Button

button number to listen to, or 0 for any button

Set_Exclusive

procedure Set_Exclusive
   (Self      : not null access Gtk_Gesture_Single_Record;
    Exclusive : Boolean)

Sets whether Gesture 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. Since: gtk+ 3.14

Parameters
Self
Exclusive

True to make Gesture exclusive

Set_Touch_Only

procedure Set_Touch_Only
   (Self       : not null access Gtk_Gesture_Single_Record;
    Touch_Only : Boolean)

If Touch_Only is True, Gesture will only handle events of type GDK_TOUCH_BEGIN, GDK_TOUCH_UPDATE or GDK_TOUCH_END. If False, mouse events will be handled too. Since: gtk+ 3.14

Parameters
Self
Touch_Only

whether Gesture handles only touch events

Touch_Only_Property

Touch_Only_Property : constant Glib.Properties.Property_Boolean;

Whether the gesture handles only touch events.