Gtk.EventController

g GObject.Object GObject.Object Gtk.EventController Gtk.EventController GObject.Object->Gtk.EventController

Subclasses:

Gtk.EventControllerKey, Gtk.EventControllerMotion, Gtk.EventControllerScroll, Gtk.Gesture, Gtk.PadController

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_propagation_phase ()

get_widget ()

handle_event (event)

reset ()

set_propagation_phase (phase)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Name

Type

Flags

Short Description

propagation-phase

Gtk.PropagationPhase

r/w/en

Propagation phase at which this controller is run

widget

Gtk.Widget

r/w/co

Widget the gesture relates to

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class Gtk.EventController(**kwargs)
Bases:

GObject.Object

Abstract:

Yes

Structure:

Gtk.EventControllerClass

Gtk.EventController is a base, low-level implementation for event controllers. Those react to a series of Gdk.Events, and possibly trigger actions as a consequence of those.

get_propagation_phase()[source]
Returns:

the propagation phase

Return type:

Gtk.PropagationPhase

Gets the propagation phase at which self handles events.

New in version 3.14.

get_widget()[source]
Returns:

a Gtk.Widget

Return type:

Gtk.Widget

Returns the Gtk.Widget this controller relates to.

New in version 3.14.

handle_event(event)[source]
Parameters:

event (Gdk.Event) – a Gdk.Event

Returns:

True if the event was potentially useful to trigger the controller action

Return type:

bool

Feeds an events into self, so it can be interpreted and the controller actions triggered.

New in version 3.14.

reset()[source]

Resets the self to a clean state. Every interaction the controller did through Gtk.EventController ::handle-event will be dropped at this point.

New in version 3.14.

set_propagation_phase(phase)[source]
Parameters:

phase (Gtk.PropagationPhase) – a propagation phase

Sets the propagation phase at which a controller handles events.

If phase is Gtk.PropagationPhase.NONE, no automatic event handling will be performed, but other additional gesture maintenance will. In that phase, the events can be managed by calling Gtk.EventController.handle_event().

New in version 3.14.

Property Details

Gtk.EventController.props.propagation_phase
Name:

propagation-phase

Type:

Gtk.PropagationPhase

Default Value:

Gtk.PropagationPhase.BUBBLE

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The propagation phase at which this controller will handle events.

New in version 3.14.

Gtk.EventController.props.widget
Name:

widget

Type:

Gtk.Widget

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The widget receiving the Gdk.Events that the controller will handle.

New in version 3.14.