Macaw OS C reference

Function ui_rect

#include <macawui.h>
int ui_rect(const char *id, int *x, int *y, int *w, int *h);

Tells you where a widget was last drawn, in the window.

Parameters

idconst char *
The widget's id, as you gave it to a text box, list, drop-down or tabs.
xint *
Pass the address of an int for its left edge, in pixels. NULL skips it.
yint *
Pass the address of an int for its top edge, in pixels. NULL skips it.
wint *
Pass the address of an int for its width, in pixels. NULL skips it.
hint *
Pass the address of an int for its height, in pixels. NULL skips it.

Returns int

1, or 0 if no widget with that id has been drawn.

In The keyboard's focus, and where widgets are, with ui_focus, ui_setfocus, ui_typing.