Laid the foundation for tabs.
This commit is contained in:
parent
bf74614ffc
commit
5f3eb6fbfa
14
new/test.c
14
new/test.c
|
@ -67,7 +67,7 @@ static void setCheckboxText(uiControl *b, void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
uiWindow *w;
|
uiWindow *w;
|
||||||
#define nStacks 8
|
#define nStacks 7
|
||||||
uiControl *stacks[nStacks];
|
uiControl *stacks[nStacks];
|
||||||
uiControl *spaced;
|
uiControl *spaced;
|
||||||
|
|
||||||
|
@ -155,6 +155,8 @@ int main(int argc, char *argv[])
|
||||||
const char *err;
|
const char *err;
|
||||||
uiControl *getButton, *setButton;
|
uiControl *getButton, *setButton;
|
||||||
uiControl *label;
|
uiControl *label;
|
||||||
|
uiControl *tab;
|
||||||
|
int page2stack;
|
||||||
|
|
||||||
memset(&o, 0, sizeof (uiInitOptions));
|
memset(&o, 0, sizeof (uiInitOptions));
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
|
@ -176,7 +178,6 @@ int main(int argc, char *argv[])
|
||||||
uiWindowOnClosing(w, onClosing, NULL);
|
uiWindowOnClosing(w, onClosing, NULL);
|
||||||
|
|
||||||
stacks[0] = uiNewVerticalStack();
|
stacks[0] = uiNewVerticalStack();
|
||||||
uiWindowSetChild(w, stacks[0]);
|
|
||||||
|
|
||||||
e = uiNewEntry();
|
e = uiNewEntry();
|
||||||
uiStackAdd(stacks[0], e, 0);
|
uiStackAdd(stacks[0], e, 0);
|
||||||
|
@ -279,6 +280,15 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
uiStackAdd(stacks[0], label, 0);
|
uiStackAdd(stacks[0], label, 0);
|
||||||
|
|
||||||
|
tab = uiNewTab();
|
||||||
|
uiWindowSetChild(w, tab);
|
||||||
|
uiTabAddPage(tab, "Page 1", stacks[0]);
|
||||||
|
|
||||||
|
page2stack = i;
|
||||||
|
stacks[i] = uiNewVerticalStack();
|
||||||
|
uiTabAddPage(tab, "Page 2", stacks[i]);
|
||||||
|
i++;
|
||||||
|
|
||||||
if (i != nStacks) {
|
if (i != nStacks) {
|
||||||
fprintf(stderr, "forgot to update nStacks\n");
|
fprintf(stderr, "forgot to update nStacks\n");
|
||||||
return 1;
|
return 1;
|
||||||
|
|
3
new/ui.h
3
new/ui.h
|
@ -107,4 +107,7 @@ uiControl *uiNewLabel(const char *);
|
||||||
char *uiLabelText(uiControl *);
|
char *uiLabelText(uiControl *);
|
||||||
void uiLabelSetText(uiControl *, const char *);
|
void uiLabelSetText(uiControl *, const char *);
|
||||||
|
|
||||||
|
uiControl *uiNewTab(void);
|
||||||
|
void uiTabAddPage(uiControl *, const char *, uiControl *);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue