natiny_view_get_focused

C
bool natiny_view_get_focused(NatinyView view);

Returns whether view itself holds the focus. Use natiny_view_get_focus_within to include descendants.

Parameters

Name Type Description
view NatinyView View handle

Returns

Type Description
bool true only when view is the focused view

Example

C
static void draw_field(NatinyView self, void* userdata) {
    if (natiny_view_get_focused(self))
        draw_caret();
}