From ee1653f542f0c070afb8310c9041267496bbdf05 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 6 Apr 2015 12:20:51 -0400 Subject: Started doing the C rewrite. Defined the basic initialization and main loop and window API and implemented them on GTK+. --- new/test.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 new/test.c (limited to 'new/test.c') 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 + +// #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; +} -- cgit v1.2.3