From 2006af51cc516356df8d3b74a33e72a818badd5e Mon Sep 17 00:00:00 2001 From: Rustam Gamidov Date: Wed, 8 Apr 2020 10:41:52 +0300 Subject: [PATCH] debug: change an example to test added functionality --- examples/controlgallery/main.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/examples/controlgallery/main.c b/examples/controlgallery/main.c index 4ba5cc8a..526eefd3 100644 --- a/examples/controlgallery/main.c +++ b/examples/controlgallery/main.c @@ -17,6 +17,13 @@ static int onShouldQuit(void *data) return 1; } +static uiEntry *focusable = NULL; +static void wideOnClicked(uiButton *b, void *data) +{ + if (focusable) + uiControlSetFocus(uiControl(focusable)); +} + static uiControl *makeBasicControlsPage(void) { uiBox *vbox; @@ -42,6 +49,7 @@ static uiControl *makeBasicControlsPage(void) uiBoxAppend(hbox, uiControl(btn), 0); + uiButtonOnClicked(btn, wideOnClicked, NULL); uiBoxAppend(vbox, uiControl(uiNewLabel("This is a label. Right now, labels can only span one line.")), @@ -59,9 +67,12 @@ static uiControl *makeBasicControlsPage(void) uiFormSetPadded(entryForm, 1); uiGroupSetChild(group, uiControl(entryForm)); + + focusable = uiNewEntry(); + uiFormAppend(entryForm, "Entry", - uiControl(uiNewEntry()), + uiControl(focusable), 0); uiFormAppend(entryForm, "Password Entry",