summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--new/test.c14
-rw-r--r--new/ui.h3
2 files changed, 15 insertions, 2 deletions
diff --git a/new/test.c b/new/test.c
index 0cbb76f..9b12cd6 100644
--- a/new/test.c
+++ b/new/test.c
@@ -67,7 +67,7 @@ static void setCheckboxText(uiControl *b, void *data)
}
uiWindow *w;
-#define nStacks 8
+#define nStacks 7
uiControl *stacks[nStacks];
uiControl *spaced;
@@ -155,6 +155,8 @@ int main(int argc, char *argv[])
const char *err;
uiControl *getButton, *setButton;
uiControl *label;
+ uiControl *tab;
+ int page2stack;
memset(&o, 0, sizeof (uiInitOptions));
for (i = 1; i < argc; i++)
@@ -176,7 +178,6 @@ int main(int argc, char *argv[])
uiWindowOnClosing(w, onClosing, NULL);
stacks[0] = uiNewVerticalStack();
- uiWindowSetChild(w, stacks[0]);
e = uiNewEntry();
uiStackAdd(stacks[0], e, 0);
@@ -279,6 +280,15 @@ int main(int argc, char *argv[])
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) {
fprintf(stderr, "forgot to update nStacks\n");
return 1;
diff --git a/new/ui.h b/new/ui.h
index d856a65..105eb66 100644
--- a/new/ui.h
+++ b/new/ui.h
@@ -107,4 +107,7 @@ uiControl *uiNewLabel(const char *);
char *uiLabelText(uiControl *);
void uiLabelSetText(uiControl *, const char *);
+uiControl *uiNewTab(void);
+void uiTabAddPage(uiControl *, const char *, uiControl *);
+
#endif