CtkGestureLongPress

CtkGestureLongPress — "Press and Hold" gesture

Functions

Properties

double delay-factor Read / Write

Signals

void cancelled Run Last
void pressed Run Last

Types and Values

Object Hierarchy

    GObject
    ╰── CtkEventController
        ╰── CtkGesture
            ╰── CtkGestureSingle
                ╰── CtkGestureLongPress

Includes

#include <ctk/ctk.h>

Description

CtkGestureLongPress is a CtkGesture implementation able to recognize long presses, triggering the “pressed” after the timeout is exceeded.

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.

Functions

ctk_gesture_long_press_new ()

CtkGesture *
ctk_gesture_long_press_new (CtkWidget *widget);

Returns a newly created CtkGesture that recognizes long presses.

Parameters

widget

a CtkWidget

 

Returns

a newly created CtkGestureLongPress

Since: 3.14

Types and Values

CtkGestureLongPress

typedef struct _CtkGestureLongPress CtkGestureLongPress;

Property Details

The “delay-factor” property

  “delay-factor”             double

Factor by which to modify the default timeout.

Owner: CtkGestureLongPress

Flags: Read / Write

Allowed values: [0.5,2]

Default value: 1

Signal Details

The “cancelled” signal

void
user_function (CtkGestureLongPress *gesture,
               gpointer             user_data)

This signal is emitted whenever a press moved too far, or was released before “pressed” happened.

Parameters

gesture

the object which received the signal

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.14


The “pressed” signal

void
user_function (CtkGestureLongPress *gesture,
               double               x,
               double               y,
               gpointer             user_data)

This signal is emitted whenever a press goes unmoved/unreleased longer than what the CTK+ defaults tell.

Parameters

gesture

the object which received the signal

 

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

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.14