summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-04-09 12:26:59 -0400
committerPietro Gagliardi <[email protected]>2015-04-09 12:26:59 -0400
commitd52a0b9a7d30875740feb0d318c3a5e5d80ab05e (patch)
tree431ee32a287aae541fab09ddcb20d020cc872b2b
parent2917d568d2b64610f0bd116320e11c05b74f47a9 (diff)
Added uiCheckboxOnToggled().
-rw-r--r--new/test.c12
-rw-r--r--new/ui.h1
2 files changed, 11 insertions, 2 deletions
diff --git a/new/test.c b/new/test.c
index cdc157d..c9a6d66 100644
--- a/new/test.c
+++ b/new/test.c
@@ -65,14 +65,20 @@ static void setCheckboxText(uiControl *b, void *data)
uiFreeText(text);
}
-uiControl *stacks[3];
+uiControl *stacks[4];
+uiControl *spaced;
+
+static void setSpaced(uiControl *c, void *data)
+{
+ // TODO
+ printf("toggled\n");
+}
int main(int argc, char *argv[])
{
uiInitError *err;
uiWindow *w;
uiControl *getButton, *setButton;
- uiControl *spaced;
err = uiInit(NULL);
if (err != NULL) {
@@ -108,7 +114,9 @@ int main(int argc, char *argv[])
uiStackAdd(stacks[2], setButton, 1);
uiStackAdd(stacks[0], stacks[2], 0);
+ // this will also be used to make sure tab stops work properly when inserted out of creation order, especially on Windows
spaced = uiNewCheckbox("Spaced");
+ uiCheckboxOnClicked(spaced, setSpaced, NULL);
stacks[3] = uiNewHorizontalStack();
getButton = uiNewButton("Get Checkbox Text");
diff --git a/new/ui.h b/new/ui.h
index 632a7ba..d87819c 100644
--- a/new/ui.h
+++ b/new/ui.h
@@ -48,5 +48,6 @@ void uiEntrySetText(uiControl *, const char *);
uiControl *uiNewCheckbox(const char *);
char *uiCheckboxText(void);
void uiCheckboxSetText(uiControl *, const char *);
+void uiCheckboxOnToggled(uiControl *, void (*)(uiControl *, void *), void *);
#endif