Has anybodody managed to make a Go-Tcl/Tk binding work under Mac OS X ?

504 views
Skip to first unread message

Serge Hulne

unread,
Sep 5, 2014, 10:17:55 AM9/5/14
to golan...@googlegroups.com
Event with the latest versions of:

- Xcode.

- "port" (port of the Linux tools for Mac)

-  Go.

I cannot get the libraries using a binding between Go and Tcl/Tk (such a /github.com/nsf/gothic ) to work correctly on a Mac.

The library compiles, but the executable runs only once and only after a reboot of the computer, but not twice :

If I attempt to restart an application based on that library the Tcl/Tk part just "hangs" and displays a blank area, the size of the expected Tk window.


Since "port" is basically simply a port of the Linux tool chain to Darwin, I would expect it to work in just the same way under Linux and Mac.

I have no idea why it does not work correctly.

Has anybody a suggestion on how to make this work ?

Thanks,
Serge.

 



Chris Sexton

unread,
Sep 5, 2014, 11:25:19 AM9/5/14
to golan...@googlegroups.com
I can't comment on the ports install, but homebrew works for me after giving the correct CGO flags to tell clang where to find the tcl-tk installation.

> brew install tcl-tk
> cd $GOPATH/src/github.com/nsf/gothic
> CGO_FLAGS='-I/usr/local/opt/tcl-tk/include' CGO_LDFLAGS='-L/usr/local/opt/tcl-tk/lib' go build

Something similar will probably work for ports.

Serge Hulne

unread,
Sep 6, 2014, 3:36:28 PM9/6/14
to Chris Sexton, golang-nuts
Thank you very much, Chris.

I tried with "homebrew" (with the corresponding modified versions of the include path and the library path), but I obtained the same result as with the MacPorts version:

- The library ("gothic") compiles without any error messages and the test provided with it works.

However, when the examples are compiled, the resulting executables sometimes start normally, sometimes just yield a blank window instead of the expected interface.

Nevertheless, thank you very much !

I give up,  I will write the interface for my Go application with JQuery and make it communicate with the executable (the server) with Ajax.

So basically, I will swap Tcl/Tk + gothic for JQuery + Ajax.

Serge.
 


--
You received this message because you are subscribed to a topic in the Google Groups "golang-nuts" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/golang-nuts/UyCndv6oylI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to golang-nuts...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Chris Sexton

unread,
Sep 7, 2014, 11:41:15 AM9/7/14
to golan...@googlegroups.com, chris....@gmail.com
I didn't consider the examples as test cases and assumed that there were just some issues somewhere between the library and the examples. I did notice the same behavior. You might check out Gustavo's go-qml library if you're dead set on having a GUI application. The limetext folks have their text editor running via go-qml and it seems to work very well under OS X considering that it's development code.

Serge Hulne

unread,
Sep 7, 2014, 2:36:35 PM9/7/14
to Chris Sexton, golang-nuts
Thank you very much !

I was not aware of this qml binding for Go.

Serge.
 

Serge Hulne

unread,
Jan 30, 2015, 6:14:23 AM1/30/15
to golan...@googlegroups.com, nsf
Hi I have, in the meantime installed :

- Yosemite (Mac OS X 10.10.1)
- The latest version of "Port" (https://www.macports.org/)
- XQuartz 2.7.7 and now it works

Nsf.s gothic (tcl/tk to Golang binding) library appers to work correctly on Mac now !

So the assumption that the problem was linked to the (late) implementation of  X11.app was correct !

Serge
Reply all
Reply to author
Forward
0 new messages