1.57 <GtkEventController>

Class: <GtkEventController>

It derives from <GObject>.

The base class for event controllers.

These are ancillary objects associated to widgets, which react to GdkEvents, and possibly trigger actions as a consequence.

Event controllers are added to a widget with widget:add-controller. It is rarely necessary to explicitly remove a controller with widget:remove-controller.

See the chapter on input handling for an overview of the basic concepts, such as the capture and bubble phases of event propagation.

Properties

Property: event-controller:name self

The name for this controller, typically used for debugging purposes.

Its value is a string, or #f.

Set it with (set! (event-controller:name self) value).

Property: event-controller:propagation-limit self

The limit for which events this controller will handle.

Its value is a <GtkPropagationLimit> (or, to set it, one of its symbols).

Set it with (set! (event-controller:propagation-limit self) value).

Property: event-controller:propagation-phase self

The propagation phase at which this controller will handle events.

Its value is a <GtkPropagationPhase> (or, to set it, one of its symbols).

Set it with (set! (event-controller:propagation-phase self) value).

Property: event-controller:widget self

The widget receiving the GdkEvents that the controller will handle.

Its value is a <GtkWidget>, or #f.

It is read only.

Procedures

Method: event-controller:get-current-event self ⇒ %return
Method: get-current-event self ⇒ %return

Returns the event that is currently being handled by the controller.

At other times, #f is returned.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a <GdkEvent>, or #f.

the event that is currently handled by self

Method: event-controller:get-current-event-device self ⇒ %return
Method: get-current-event-device self ⇒ %return

Returns the device of the event that is currently being handled by the controller.

At other times, #f is returned.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a <GdkDevice>, or #f.

device of the event is currently handled by self

Method: event-controller:get-current-event-state self ⇒ %return
Method: get-current-event-state self ⇒ %return

Returns the modifier state of the event that is currently being handled by the controller.

At other times, 0 is returned.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a <GdkModifierType>.

modifier state of the event is currently handled by self

Method: event-controller:get-current-event-time self ⇒ %return
Method: get-current-event-time self ⇒ %return

Returns the timestamp of the event that is currently being handled by the controller.

At other times, 0 is returned.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: an unsigned 32-bit integer.

timestamp of the event is currently handled by self

Method: event-controller:get-name self ⇒ %return
Method: get-name self ⇒ %return

Gets the name of self.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a string, or #f.

The controller name

Method: event-controller:get-propagation-limit self ⇒ %return
Method: get-propagation-limit self ⇒ %return

Gets the propagation limit of the event controller.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a <GtkPropagationLimit>.

the propagation limit

Method: event-controller:get-propagation-phase self ⇒ %return
Method: get-propagation-phase self ⇒ %return

Gets the propagation phase at which self handles events.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a <GtkPropagationPhase>.

the propagation phase

Method: event-controller:get-widget self ⇒ %return
Method: get-widget self ⇒ %return

Returns the <GtkWidget> this controller relates to.

self

Passed: a <GtkEventController>.

a <GtkEventController>

%return

Returned: a <GtkWidget>, or #f.

a <GtkWidget>

Method: event-controller:reset self
Method: reset self

Resets the self to a clean state.

self

Passed: a <GtkEventController>.

a <GtkEventController>

Method: event-controller:set-name self [name]
Method: set-name self [name]

Sets a name on the controller that can be used for debugging.

self

Passed: a <GtkEventController>.

a <GtkEventController>

name

Passed, or left out: a string, or #f.

a name for self

Method: event-controller:set-propagation-limit self limit
Method: set-propagation-limit self limit

Sets the event propagation limit on the event controller.

If the limit is set to same-native, the controller won’t handle events that are targeted at widgets on a different surface, such as popovers.

self

Passed: a <GtkEventController>.

a <GtkEventController>

limit

Passed: a <GtkPropagationLimit>, or one of its symbols.

the propagation limit

Method: event-controller:set-propagation-phase self phase
Method: set-propagation-phase self phase

Sets the propagation phase at which a controller handles events.

If phase is none, no automatic event handling will be performed, but other additional gesture maintenance will.

self

Passed: a <GtkEventController>.

a <GtkEventController>

phase

Passed: a <GtkPropagationPhase>, or one of its symbols.

a propagation phase

Method: event-controller:set-static-name self [name]
Method: set-static-name self [name]

Sets a name on the controller that can be used for debugging.

self

Passed: a <GtkEventController>.

a <GtkEventController>

name

Passed, or left out: a string, or #f.

a name for self, must be a static string