> Is there a way to pass a callback routine to c using cgo?Yes. Ian just added support for this.
See misc/cgo/life for an exmaple.
> Would SWIG be suited to to automatically create bindings between Go
> and GTK+ ?
>
> After all if I look at Python, It appears that Python bindings to GTK
> +, WxWindows, FLTK, etc ... are generated automatically using SWIG.
If SWIG works for Python, then it should work for Go.
The SWIG code is not yet finalized, but it is close. It has been
committed to the swig SVN repository, but there is still a bit more
tweaking before it can be considered finished.
Ian
> May I ask, if you could notify me when SWIG for Go becomes
> operational.
I will send mail to the golang-nuts list.
> I would like to try to assess how easy (or how complex) it would be to
> attempt to generate GTK+ bindings for Go.
>
> However, I would rather prefer to wait until SWIG is ripe enough, so
> that said test wouldn't be biased by additional difficulties which
> might arise from a SWIG version which wouldn't be reasonably stable.
Oh, you can certainly try it now. In fact, I would encourage you to
do so, and report any problems that you find. The details which
remain are things like the precise names to use in the generated
wrapping code.
Ian
> I installed swig with:
>
> svn co https://swig.svn.sourceforge.net/svnroot/swig/trunk swig
>
> It compiled, but when doing the make install, I got:
>
> Installing ccache-swig
> Installing /usr/local/bin/ccache-swig
> Installing /usr/local/share/man/man1/ccache-swig.1
> install: ./ccache-swig.1: No such file or directory
> make[1]: *** [install] Error 71
>
> I am using Mac OS X 10.6 (with the XCode code).
I don't know why this happens, but I think you can avoid it by using
the --disable-ccache option when you run configure.
Ian