### Method

# Gtk Widget child_focus

#### Declaration [src]

    gboolean
    gtk_widget_child_focus (
      GtkWidget* widget,
      GtkDirectionType direction
    )

#### Description [src]

Called by widgets as the user moves around the window using keyboard shortcuts.

The `direction` argument indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward).

This function calls the `Gtk.WidgetClass.focus` virtual function; widgets can override the virtual function in order to implement appropriate focus behavior.

The default `focus()` virtual function 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. When returning true, widgets normally call `gtk_widget_grab_focus()` to place the focus accordingly; when returning false, they don’t modify the current focus location.

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.

#### Parameters

`direction`

  Type: `GtkDirectionType`

  Direction of focus movement.

#### Return value

Type: `gboolean`

True if focus ended up inside `widget`.