Widget.childFocus

bool childFocus(gtk.types.DirectionType direction)

This function is used by custom widget implementations; if you're writing an app, you’d use [gtk.widget.Widget.grabFocus] to move the focus to a particular widget, and [gtk.container.Container.setFocusChain] to change the focus tab order. So you may want to investigate those functions instead.

[gtk.widget.Widget.childFocus] is called by containers as the user moves around the window using keyboard shortcuts. direction indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). [gtk.widget.Widget.childFocus] emits the #GtkWidget::focus signal; widgets override the default handler for this signal in order to implement appropriate focus behavior.

The default ::focus handler for a widget should return true if moving in direction left the focus on a focusable location inside that widget, and false if moving in direction moved the focus outside the widget. If returning true, widgets normally call [gtk.widget.Widget.grabFocus] to place the focus accordingly; if returning false, they don’t modify the current focus location.

Parameters

directiondirection of focus movement

Returns

true if focus ended up inside widget