diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-06 12:20:51 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-06 12:20:51 -0400 |
| commit | ee1653f542f0c070afb8310c9041267496bbdf05 (patch) | |
| tree | b18654d87e569457a61ad15d0955ad9c53efd0e7 /new/test.c | |
| parent | 50577098478ed0e7cfb3f2a417bddb16187929f6 (diff) | |
Started doing the C rewrite. Defined the basic initialization and main loop and window API and implemented them on GTK+.
Diffstat (limited to 'new/test.c')
| -rw-r--r-- | new/test.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/new/test.c b/new/test.c new file mode 100644 index 0000000..cd35a5b --- /dev/null +++ b/new/test.c @@ -0,0 +1,32 @@ +// 6 april 2015 +#include "ui.h" +#include <stdio.h> + +// #qo pkg-config: gtk+-3.0 + +int onClosing(uiWindow *w, void *data) +{ + printf("in closing!\n"); + uiQuit(); + return 1; +} + +int main(void) +{ + uiInitError *err; + uiWindow *w; + + err = uiInit(NULL); + if (err != NULL) { + fprintf(stderr, "error initializing ui: %s\n", uiInitErrorMessage(err)); + uiInitErrorFree(err); + return 1; + } + + w = uiNewWindow("Hello", 320, 240); + uiWindowOnClosing(w, onClosing, NULL); + uiWindowShow(w); + + uiMain(); + return 0; +} |
