Gtk.Widget.prototype.send_focus_change
function send_focus_change(event:Gdk.Event):Boolean { // Gjs wrapper for gtk_widget_send_focus_change() }
Sends the focus change event to widget
This function is not meant to be used by applications. The only time it should be used is when it is necessary for a Gtk.Widget to assign focus to a widget that is semantically owned by the first widget even though it's not a direct child - for instance, a search entry in a floating window similar to the quick search in Gtk.TreeView.
An example of its usage is:
|[ GdkEvent *fevent = gdk_event_new (GDK_FOCUS_CHANGE);
fevent->focus_change.type = GDK_FOCUS_CHANGE; fevent->focus_change.in = TRUE; fevent->focus_change.window = gtk_widget_get_window (widget); if (fevent->focus_change.window != NULL) g_object_ref (fevent->focus_change.window);
gtk_widget_send_focus_change (widget, fevent);
gdk_event_free (event); ]|
Since 2.20
- event
a Gdk.Event of type GDK_FOCUS_CHANGE
- Returns
the return value from the event signal emission: true if the event was handled, and false otherwise