natiny.view.get_focus_within

Lua
natiny.view.get_focus_within(view) -> within

Returns whether view has focus or contains the focused view at any depth.

Parameters

Name Type Description
view number View handle

Returns

Type Description
boolean true for the focused view and each of its ancestors; otherwise false

Example

Lua
local color = natiny.view.get_focus_within(panel) and ACCENT or LINE
natiny.render.set_color(color)