From 38eecd3fc3538c597a032c940519ffdb78cffd82 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 7 Apr 2015 19:11:21 -0400 Subject: Wrote in the Stack test. The only thing left is to implement uiButton.preferredSize()... --- new/test.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'new/test.c') diff --git a/new/test.c b/new/test.c index 1f8eca0..1d9cec5 100644 --- a/new/test.c +++ b/new/test.c @@ -10,15 +10,21 @@ int onClosing(uiWindow *w, void *data) } void onClicked(uiControl *b, void *data) +{ + // TODO +} + +void onClicked2(uiControl *b, void *data) { printf("button clicked!\n"); } -int main(void) +int main(int argc, char *argv[]) { uiInitError *err; uiWindow *w; - uiControl *button; + uiControl *stack; + uiControl *button, *button2; err = uiInit(NULL); if (err != NULL) { @@ -30,9 +36,19 @@ int main(void) w = uiNewWindow("Hello", 320, 240); uiWindowOnClosing(w, onClosing, NULL); + if (argc > 1) + stack = uiNewHorizontalStack(); + else + stack = uiNewVerticalStack(); + uiWindowSetChild(w, stack); + + button2 = uiNewButton("Change Me"); + uiButtonOnClicked(button, onClicked2, NULL); + button = uiNewButton("Click Me"); - uiButtonOnClicked(button, onClicked, NULL); - uiWindowSetChild(w, button); + uiButtonOnClicked(button, onClicked, button2); + uiStackAdd(stack, button, 1); + uiStackAdd(stack, button2, 0); uiWindowShow(w); uiMain(); -- cgit v1.2.3