Added uiCheckboxOnToggled().
This commit is contained in:
parent
2917d568d2
commit
d52a0b9a7d
12
new/test.c
12
new/test.c
|
@ -65,14 +65,20 @@ static void setCheckboxText(uiControl *b, void *data)
|
||||||
uiFreeText(text);
|
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[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
uiInitError *err;
|
uiInitError *err;
|
||||||
uiWindow *w;
|
uiWindow *w;
|
||||||
uiControl *getButton, *setButton;
|
uiControl *getButton, *setButton;
|
||||||
uiControl *spaced;
|
|
||||||
|
|
||||||
err = uiInit(NULL);
|
err = uiInit(NULL);
|
||||||
if (err != NULL) {
|
if (err != NULL) {
|
||||||
|
@ -108,7 +114,9 @@ int main(int argc, char *argv[])
|
||||||
uiStackAdd(stacks[2], setButton, 1);
|
uiStackAdd(stacks[2], setButton, 1);
|
||||||
uiStackAdd(stacks[0], stacks[2], 0);
|
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");
|
spaced = uiNewCheckbox("Spaced");
|
||||||
|
uiCheckboxOnClicked(spaced, setSpaced, NULL);
|
||||||
|
|
||||||
stacks[3] = uiNewHorizontalStack();
|
stacks[3] = uiNewHorizontalStack();
|
||||||
getButton = uiNewButton("Get Checkbox Text");
|
getButton = uiNewButton("Get Checkbox Text");
|
||||||
|
|
1
new/ui.h
1
new/ui.h
|
@ -48,5 +48,6 @@ void uiEntrySetText(uiControl *, const char *);
|
||||||
uiControl *uiNewCheckbox(const char *);
|
uiControl *uiNewCheckbox(const char *);
|
||||||
char *uiCheckboxText(void);
|
char *uiCheckboxText(void);
|
||||||
void uiCheckboxSetText(uiControl *, const char *);
|
void uiCheckboxSetText(uiControl *, const char *);
|
||||||
|
void uiCheckboxOnToggled(uiControl *, void (*)(uiControl *, void *), void *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue