This function is used by custom widget implementations; if you're
writing an app, you'd use gtk_widget_grab_focus() to move the focus
to a particular widget, and gtk_container_set_focus_chain() to
change the focus tab order. So you may want to investigate those
functions instead.
gtk_widget_child_focus() 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_child_focus() emits the
"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_grab_focus() to place the focus accordingly;
if returning FALSE, they don't modify the current focus location.
This function replaces gtk_container_focus() from GTK+ 1.2.
It was necessary to check that the child was visible, sensitive,
and focusable before calling gtk_container_focus().
gtk_widget_child_focus() returns FALSE if the widget is not
currently in a focusable state, so there's no need for those checks.
This function is used by custom widget implementations; if you're writing an app, you'd use gtk_widget_grab_focus() to move the focus to a particular widget, and gtk_container_set_focus_chain() to change the focus tab order. So you may want to investigate those functions instead. gtk_widget_child_focus() 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_child_focus() emits the "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_grab_focus() to place the focus accordingly; if returning FALSE, they don't modify the current focus location. This function replaces gtk_container_focus() from GTK+ 1.2. It was necessary to check that the child was visible, sensitive, and focusable before calling gtk_container_focus(). gtk_widget_child_focus() returns FALSE if the widget is not currently in a focusable state, so there's no need for those checks.