Gtk.EventController¶
- Subclasses:
Gtk.DropControllerMotion,Gtk.DropTarget,Gtk.DropTargetAsync,Gtk.EventControllerFocus,Gtk.EventControllerKey,Gtk.EventControllerLegacy,Gtk.EventControllerMotion,Gtk.EventControllerScroll,Gtk.Gesture,Gtk.PadController,Gtk.ShortcutController
Methods¶
- Inherited:
- Structs:
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
|---|---|---|---|
r/w |
|||
r/w/en |
|||
r/w/en |
|||
r |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class Gtk.EventController(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
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 [method`Gtk`.Widget.add_controller]. It is rarely necessary to explicitly remove a controller with [method`Gtk`.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.
- get_current_event()[source]¶
-
Returns the event that is currently being handled by the controller.
At other times,
Noneis returned.
- get_current_event_device()[source]¶
- Returns:
device of the event is currently handled by self
- Return type:
Gdk.DeviceorNone
Returns the device of the event that is currently being handled by the controller.
At other times,
Noneis returned.
- get_current_event_state()[source]¶
- Returns:
modifier state of the event is currently handled by self
- Return type:
Returns the modifier state of the event that is currently being handled by the controller.
At other times, 0 is returned.
- get_current_event_time()[source]¶
- Returns:
timestamp of the event is currently handled by self
- Return type:
Returns the timestamp of the event that is currently being handled by the controller.
At other times, 0 is returned.
- get_propagation_limit()[source]¶
- Returns:
the propagation limit
- Return type:
Gets the propagation limit of the event controller.
- get_propagation_phase()[source]¶
- Returns:
the propagation phase
- Return type:
Gets the propagation phase at which self handles events.
- get_widget()[source]¶
- Returns:
a
GtkWidget- Return type:
Gtk.WidgetorNone
Returns the
GtkWidgetthis controller relates to.
- set_propagation_limit(limit)[source]¶
- Parameters:
limit (
Gtk.PropagationLimit) – the propagation limit
Sets the event propagation limit on the event controller.
If the limit is set to
Gtk.PropagationLimit.SAME_NATIVE, the controller won’t handle events that are targeted at widgets on a different surface, such as popovers.
- 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.
Property Details¶
- Gtk.EventController.props.name¶
-
The name for this controller, typically used for debugging purposes.
- Gtk.EventController.props.propagation_limit¶
- Name:
propagation-limit- Type:
- Default Value:
- Flags:
The limit for which events this controller will handle.
- Gtk.EventController.props.propagation_phase¶
- Name:
propagation-phase- Type:
- Default Value:
- Flags:
The propagation phase at which this controller will handle events.
- Gtk.EventController.props.widget¶
- Name:
widget- Type:
- Default Value:
- Flags:
The widget receiving the
GdkEventsthat the controller will handle.