From c529ba86cf45f09fccd765c69a24e61c1d774141 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 25 Nov 2015 17:25:57 -0500 Subject: [PATCH] Wrote a C version of xtest.go. I need to somehow restore the .net error handler in the Go code... --- wpf/xtest.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 wpf/xtest.c diff --git a/wpf/xtest.c b/wpf/xtest.c new file mode 100644 index 00000000..d46b6b82 --- /dev/null +++ b/wpf/xtest.c @@ -0,0 +1,23 @@ +// 25 november 2015 +#include +#include "../ui.h" +int onClosing(uiWindow *w, void *data) +{ + printf("in closing\n"); + uiQuit(); + return 1; +} +int main(void) +{ + uiInitOptions o; + uiWindow *w; + if (uiInit(&o) != NULL) return 1; + w = uiNewWindow("Hello from C", + 320, 240, 0); + uiWindowOnClosing(w, onClosing, NULL); + uiControlShow(uiControl(w)); + uiMain(); + printf("after main\n"); + uiUninit(); + printf("out\n"); +}