Recognizes long press gestures.
This gesture is also known as "Press and Hold".
When the timeout is exceeded, the gesture is triggering the [signalGtk.GestureLongPress::pressed] signal.
If the touchpoint is lifted before the timeout passes, or if it drifts too far of the initial press point, the [signalGtk.GestureLongPress::cancelled] signal will be emitted.
How long the timeout is before the ::pressed signal gets emitted is determined by the [propertyGtk.Settings:gtk-long-press-time] setting. It can be modified by the [propertyGtk.GestureLongPress:delay-factor] property.
<gtkada_demo>create_gestures.adb</gtkada_demo>
type Cb_GObject_Gdouble_Gdouble_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class;
X : Gdouble;
Y : Gdouble);
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Gesture_Long_Press_Gdouble_Gdouble_Void is not null access procedure
(Self : access Gtk_Gesture_Long_Press_Record'Class;
X : Gdouble;
Y : Gdouble);
type Cb_Gtk_Gesture_Long_Press_Void is not null access procedure
(Self : access Gtk_Gesture_Long_Press_Record'Class);
Delay_Factor_Property : constant Glib.Properties.Property_Double;
Type: Gdouble Factor by which to modify the default timeout.
function Get_Delay_Factor
(Self : not null access Gtk_Gesture_Long_Press_Record) return Gdouble
Returns the delay factor.
the delay factor
function Get_Type return Glib.GType
type Gtk_Gesture_Long_Press is access all Gtk_Gesture_Long_Press_Record'Class;
function Gtk_Gesture_Long_Press_New return Gtk_Gesture_Long_Press
Returns a newly created GtkGesture that recognizes long presses.
type Gtk_Gesture_Long_Press_Record is new Gtk_Gesture_Single_Record with null record;
procedure Gtk_New (Self : out Gtk_Gesture_Long_Press)
Returns a newly created GtkGesture that recognizes long presses. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize
(Self : not null access Gtk_Gesture_Long_Press_Record'Class)
Returns a newly created GtkGesture that recognizes long presses. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure On_Cancelled
(Self : not null access Gtk_Gesture_Long_Press_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted whenever a press moved too far, or was released before [signalGtk.GestureLongPress::pressed] happened.
procedure On_Cancelled
(Self : not null access Gtk_Gesture_Long_Press_Record;
Call : Cb_Gtk_Gesture_Long_Press_Void;
After : Boolean := False)
Emitted whenever a press moved too far, or was released before [signalGtk.GestureLongPress::pressed] happened.
procedure On_Pressed
(Self : not null access Gtk_Gesture_Long_Press_Record;
Call : Cb_GObject_Gdouble_Gdouble_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.
Callback parameters: -- @param X the X coordinate where the press happened, relative to the -- widget allocation -- @param Y the Y coordinate where the press happened, relative to the -- widget allocation
procedure On_Pressed
(Self : not null access Gtk_Gesture_Long_Press_Record;
Call : Cb_Gtk_Gesture_Long_Press_Gdouble_Gdouble_Void;
After : Boolean := False)
Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.
Callback parameters: -- @param X the X coordinate where the press happened, relative to the -- widget allocation -- @param Y the Y coordinate where the press happened, relative to the -- widget allocation
procedure Set_Delay_Factor
(Self : not null access Gtk_Gesture_Long_Press_Record;
Delay_Factor : Gdouble)
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].
The delay factor to apply
Signal_Cancelled : constant Glib.Signal_Name := "cancelled";
Emitted whenever a press moved too far, or was released before [signalGtk.GestureLongPress::pressed] happened.
Signal_Pressed : constant Glib.Signal_Name := "pressed";
Emitted whenever a press goes unmoved/unreleased longer than what the GTK defaults tell.
Callback parameters: -- @param X the X coordinate where the press happened, relative to the -- widget allocation -- @param Y the Y coordinate where the press happened, relative to the -- widget allocation