I've been looking for something like this for years!
>I know there were previous attempts
aye, I'd found three of 'em, and couldn't get any of them to work

It only worked (on Windows, "go get github.com/gen2brain/iup-go/iup") after I 
upgraded Go from 1.16 to 1.18.2, the requirements should probably state that.
Excellent stuff!
     On Tuesday, 31 May 2022, 08:28:05 BST, Milan Nikolic <gen2br...@gmail.com> 
wrote:  
 
 Hi,
I just released the bindings for Go at https://github.com/gen2brain/iup-go. I 
know there were previous attempts, my bindings include IUP C source code that 
is compiled together with bindings. 
That means it is enough to just `go build` your app, or add tags like `gtk` to 
force GTK+ on macOS and Windows, and even `motif` tag, to build for Motif.
I also rewrote many examples and added some new ones, like postmessage, which 
uses goroutine, and an image example that shows how to use Go standard 
libraries to load images.These are only bindings for core IUP, IM is not needed 
as Go has jpeg, png, gif, etc. in the standard library. CD I cannot include 
easily and it needs many dependencies, so no additional controls.I just added 
the support for GLCanvas, but I really miss Matrix and Cell controls.
I added the Cocoa code and sample screenshot on purpose, hope it can attract 
contributions. Native controls I believe are more relevant than ever.There was 
some attempt, libui/ui project in C, with Go bindings, some Googler started, 
but there is no progress for years, I guess it is not an easy task to do from 
scratch.
Btw. I noticed that postmessage crashes in Motif, there is an easy fix, 
user_data is just not passed:
        diff -ur iup.orig/src/mot/iupmot_loop.c iup/src/mot/iupmot_loop.c
        --- iup.orig/src/mot/iupmot_loop.c 2019-08-28 12:28:11.000000000 +0200
        +++ iup/src/mot/iupmot_loop.c 2022-05-31 09:14:45.632250635 +0200
        @@ -163,5 +163,5 @@
           user_data->i = i;
           user_data->d = d;
           user_data->p = p;
        -  XtAppAddWorkProc(iupmot_appcontext, motPostMessagebWorkProc, NULL);
        +  XtAppAddWorkProc(iupmot_appcontext, motPostMessagebWorkProc, 
user_data);
         }


I also have issues with the IupThread example I wrote, it seems to start/stop 
correctly, but it crashes on IupClose.It is a simple example, I will try to 
rewrite it in C to see if it happens there.
Thank you for the amazing UI toolkit.
Milan
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users
  
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to