Widget.grabFocus

Causes @widget to have the keyboard focus for the GtkWindow it's inside.

If @widget is not focusable, or its ::grab_focus implementation cannot transfer the focus to a descendant of @widget that is focusable, it will not take focus and %FALSE will be returned.

Calling [method@Gtk.Widget.grab_focus] on an already focused widget is allowed, should not have an effect, and return %TRUE.

class Widget
bool
grabFocus
()

Return Value

Type: bool

%TRUE if focus is now inside @widget.

Meta