2015-04-22 16:40:58 -05:00
|
|
|
// 22 april 2015
|
|
|
|
#include "test.h"
|
|
|
|
|
2015-04-22 16:54:05 -05:00
|
|
|
void die(const char *fmt, ...)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
abort();
|
|
|
|
}
|
|
|
|
|
2015-04-22 18:23:34 -05:00
|
|
|
int onClosing(uiWindow *w, void *data)
|
2015-04-22 16:40:58 -05:00
|
|
|
{
|
2015-04-22 18:23:34 -05:00
|
|
|
printf("in onClosing()\n");
|
|
|
|
uiQuit();
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
|
|
{
|
|
|
|
uiInitOptions o;
|
|
|
|
int i;
|
|
|
|
const char *err;
|
|
|
|
uiWindow *w;
|
|
|
|
|
|
|
|
memset(&o, 0, sizeof (uiInitOptions));
|
|
|
|
for (i = 1; i < argc; i++)
|
|
|
|
if (strcmp(argv[i], "leaks") == 0)
|
|
|
|
o.debugLogAllocations = 1;
|
|
|
|
else {
|
|
|
|
fprintf(stderr, "%s: unrecognized option %s\n", argv[0], argv[i]);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
err = uiInit(&o);
|
|
|
|
if (err != NULL) {
|
|
|
|
fprintf(stderr, "error initializing ui: %s\n", err);
|
|
|
|
uiFreeInitError(err);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
2015-04-24 14:26:37 -05:00
|
|
|
initMenus();
|
2015-04-23 17:22:06 -05:00
|
|
|
|
2015-04-22 18:23:34 -05:00
|
|
|
w = newWindow("Main Window", 320, 240, 1);
|
|
|
|
uiWindowOnClosing(w, onClosing, NULL);
|
|
|
|
|
2015-04-23 18:06:52 -05:00
|
|
|
uiWindowShow(newWindow("Second Window", 320, 240, 1));
|
|
|
|
|
2015-04-22 18:23:34 -05:00
|
|
|
uiWindowShow(w);
|
|
|
|
uiMain();
|
|
|
|
printf("after uiMain()\n");
|
2015-04-22 16:40:58 -05:00
|
|
|
return 0;
|
|
|
|
}
|