src/swipl-devel/packages/xpce/man/refmanual/md/click_gesture.md

class click_gesture {#class-click_gesture}

A click_gesture can be used to make any graphical behave as a button. It allows you the mouse-button that should be recognised; the state of the modifier buttons and the multiclick status (single, double, triple clicks).

The above forms the condition part. The action part consists of three messages. When the mouse goes down, the <-preview_message is sent. Next, when the mouse goes up inside the area of the graphical, the <-execute_message is activated, otherwise the <-cancel_message. For all these messages, the following arguments are forwarded:

| @receiver | The receiving graphical object |
| @arg1     | The event                      |

Normally, the <-preview_message indicates that releasing the button here will start some command. The execute message will execute the command and remove the feedback provided by the preview and the cancel message just removes this feedback.

@see event<-multiclick @see class button

Instance variables {#class-click_gesture-instvars}

Send methods {#class-click_gesture-send}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.