Gtk.EventControllerFocus¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
|||
r |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Emitted whenever the focus enters into the widget or one of its descendents. |
|
Emitted whenever the focus leaves the widget hierarchy that is rooted at the widget that the controller is attached to. |
Fields¶
- Inherited:
Class Details¶
- class Gtk.EventControllerFocus(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
GtkEventControllerFocus
is an event controller to keep track of keyboard focus.The event controller offers [signal`Gtk`.EventControllerFocus::enter] and [signal`Gtk`.EventControllerFocus::leave] signals, as well as [property`Gtk`.EventControllerFocus:is-focus] and [property`Gtk`.EventControllerFocus:contains-focus] properties which are updated to reflect focus changes inside the widget hierarchy that is rooted at the controllers widget.
- classmethod new()[source]¶
- Returns:
a new
GtkEventControllerFocus
- Return type:
Creates a new event controller that will handle focus events.
Signal Details¶
- Gtk.EventControllerFocus.signals.enter(event_controller_focus)¶
- Signal Name:
enter
- Flags:
- Parameters:
event_controller_focus (
Gtk.EventControllerFocus
) – The object which received the signal
Emitted whenever the focus enters into the widget or one of its descendents.
Note that this means you may not get an
::enter
signal even though the widget becomes the focus location, in certain cases (such as when the focus moves from a descendent of the widget to the widget itself). If you are interested in these cases, you can monitor the [property`Gtk`.EventControllerFocus:is-focus] property for changes.
- Gtk.EventControllerFocus.signals.leave(event_controller_focus)¶
- Signal Name:
leave
- Flags:
- Parameters:
event_controller_focus (
Gtk.EventControllerFocus
) – The object which received the signal
Emitted whenever the focus leaves the widget hierarchy that is rooted at the widget that the controller is attached to.
Note that this means you may not get a
::leave
signal even though the focus moves away from the widget, in certain cases (such as when the focus moves from the widget to a descendent). If you are interested in these cases, you can monitor the [property`Gtk`.EventControllerFocus:is-focus] property for changes.
Property Details¶
- Gtk.EventControllerFocus.props.contains_focus¶
-
True
if focus is contained in the controllers widget.See [property`Gtk`.EventControllerFocus:is-focus] for whether the focus is in the widget itself or inside a descendent.
When handling focus events, this property is updated before [signal`Gtk`.EventControllerFocus::enter] or [signal`Gtk`.EventControllerFocus::leave] are emitted.
- Gtk.EventControllerFocus.props.is_focus¶
-
True
if focus is in the controllers widget itself, as opposed to in a descendent widget.See also [property`Gtk`.EventControllerFocus:contains-focus].
When handling focus events, this property is updated before [signal`Gtk`.EventControllerFocus::enter] or [signal`Gtk`.EventControllerFocus::leave] are emitted.