libui/redo/test/page4.c

32 lines
627 B
C
Raw Normal View History

// 19 may 2015
#include "test.h"
static uiSpinbox *spinbox;
2015-05-19 20:05:18 -05:00
static uiProgressBar *pbar;
2015-05-19 17:17:30 -05:00
#define CHANGED(what) \
static void on ## what ## Changed(ui ## what *this, void *data) \
{ \
2015-05-19 20:05:18 -05:00
uintmax_t value; \
2015-05-19 17:17:30 -05:00
printf("on %s changed\n", #what); \
2015-05-19 20:05:18 -05:00
value = ui ## what ## Value(this); \
uiProgressBarSetValue(pbar, value); \
2015-05-19 17:17:30 -05:00
}
CHANGED(Spinbox)
uiBox *makePage4(void)
{
uiBox *page4;
page4 = newVerticalBox();
spinbox = uiNewSpinbox();
2015-05-19 17:17:30 -05:00
uiSpinboxOnChanged(spinbox, onSpinboxChanged, NULL);
uiBoxAppend(page4, uiControl(spinbox), 0);
2015-05-19 20:05:18 -05:00
pbar = uiNewProgressBar();
uiBoxAppend(page4, uiControl(pbar), 0);
return page4;
}