Tracks keyboard focus.
The event controller offers [signalGtk.EventControllerFocus::enter] and [signalGtk.EventControllerFocus::leave] signals, as well as [propertyGtk.EventControllerFocus:is-focus] and [propertyGtk.EventControllerFocus:contains-focus] properties which are updated to reflect focus changes inside the widget hierarchy that is rooted at the controllers widget.
type Cb_GObject_Void is not null access procedure
(Self : access Glib.Object.GObject_Record'Class);
type Cb_Gtk_Event_Controller_Focus_Void is not null access procedure
(Self : access Gtk_Event_Controller_Focus_Record'Class);
function Contains_Focus
(Self : not null access Gtk_Event_Controller_Focus_Record)
return Boolean
Returns True if focus is within Self or one of its children.
True if focus is within Self or one of its children
Contains_Focus_Property : constant Glib.Properties.Property_Boolean;
True if focus is contained in the controllers widget.
See [propertyGtk.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 [signalGtk.EventControllerFocus::enter] or [signalGtk.EventControllerFocus::leave] are emitted.
function Get_Type return Glib.GType
type Gtk_Event_Controller_Focus is access all Gtk_Event_Controller_Focus_Record'Class;
function Gtk_Event_Controller_Focus_New return Gtk_Event_Controller_Focus
Creates a new event controller that will handle focus events.
type Gtk_Event_Controller_Focus_Record is new Gtk_Event_Controller_Record with null record;
procedure Gtk_New (Self : out Gtk_Event_Controller_Focus)
Creates a new event controller that will handle focus events. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
procedure Initialize
(Self : not null access Gtk_Event_Controller_Focus_Record'Class)
Creates a new event controller that will handle focus events. Initialize does nothing if the object was already created with another call to Initialize* or G_New.
function Is_Focus
(Self : not null access Gtk_Event_Controller_Focus_Record)
return Boolean
Returns True if focus is within Self, but not one of its children.
True if focus is within Self, but not one of its children
Is_Focus_Property : constant Glib.Properties.Property_Boolean;
True if focus is in the controllers widget itself, as opposed to in a descendent widget.
See also [propertyGtk.EventControllerFocus:contains-focus].
When handling focus events, this property is updated before [signalGtk.EventControllerFocus::enter] or [signalGtk.EventControllerFocus::leave] are emitted.
procedure On_Enter
(Self : not null access Gtk_Event_Controller_Focus_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
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 [propertyGtk.EventControllerFocus:is-focus] property for changes.
procedure On_Enter
(Self : not null access Gtk_Event_Controller_Focus_Record;
Call : Cb_Gtk_Event_Controller_Focus_Void;
After : Boolean := False)
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 [propertyGtk.EventControllerFocus:is-focus] property for changes.
procedure On_Leave
(Self : not null access Gtk_Event_Controller_Focus_Record;
Call : Cb_GObject_Void;
Slot : not null access Glib.Object.GObject_Record'Class;
After : Boolean := False)
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 [propertyGtk.EventControllerFocus:is-focus] property for changes.
procedure On_Leave
(Self : not null access Gtk_Event_Controller_Focus_Record;
Call : Cb_Gtk_Event_Controller_Focus_Void;
After : Boolean := False)
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 [propertyGtk.EventControllerFocus:is-focus] property for changes.
Signal_Enter : constant Glib.Signal_Name := "enter";
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 [propertyGtk.EventControllerFocus:is-focus] property for changes.
Signal_Leave : constant Glib.Signal_Name := "leave";
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 [propertyGtk.EventControllerFocus:is-focus] property for changes.