Stand-alone GUI App with Go.

1,046 views
Skip to first unread message

Peter Howard

unread,
Oct 22, 2015, 11:33:27 AM10/22/15
to golang-nuts
This small Go program (200 SLOC), implements a skeleton stand-alone GUI app. An alternative perhaps to the C++ / Qt combination. It is a bundled-up HTML5 web app, which combines a local web server and html page content delivery into a single Go executable intended to be deployed locally. It uses Go's HTML templating, plus Bootstrap CSS for GUI layout, controls and styling, but compiles all these auxiliary file resources into the single executable using the https://github.com/jteeuwen/go-bindata package. Consequently the executable has no runtime dependencies on additional files, and in fact makes no runtime disk access. It is dependent of course on a browser to render it, so perhaps should be described as stand-almost-alone.

The repository, also contains a screenshot and a pre-compiled windows binary.

timinga...@gmail.com

unread,
Oct 24, 2015, 4:01:19 PM10/24/15
to golang-nuts
I posted a question on reddit golang recently about writing a CAD application in Go.  I'm new to web app development but have create a Java CAD application that uses 2D graphics and outputs the drawings in SVG and PNG but it also programmable with Jython scripts.  I would love to convert this to Go.  


Do think this methodolgy you used in the godesktopgui example would work for my needs.  Please see the attached link above for the post I mentioned above that describes what I'm trying to do.  

Thank you.

Peter Howard

unread,
Oct 26, 2015, 9:09:04 AM10/26/15
to golang-nuts
Can we generalize your requirements as being to provide graphical interaction with vector graphics in the browser? If so, then yes the methodology in godesktopgui would work. To display the vector graphics you would make the server respond to requests with pages that contained SVG inline content. The browsers will render this graphics content themselves. You will need to handle user input with some javascript carried by the web page, and convey the user's intent back to the server in an http post.This link demonstrates SVG in the browser: 

timinga...@gmail.com

unread,
Oct 26, 2015, 7:37:11 PM10/26/15
to golang-nuts
Yes.  My application draws diagrams using Java2D so I would convert that to Go and output SVG diagrams to be displayed in the browser.  Would you use javascript to make the GUI text inputs/ comboboxes and then how would you get keyboard and mouse events from javascript back to the server?   

Peter Howard

unread,
Oct 27, 2015, 4:52:33 AM10/27/15
to golang-nuts
We should factor this strand of the topic outside of this forum because it is not Go specific.
I will send you a private message, where we can pick it up.
Pete

Ignazio Di Napoli

unread,
Nov 2, 2015, 12:35:36 PM11/2/15
to golang-nuts
For a cad I used goqml and opengl, and I am happy with it.
This one seems promising, and easier to deploy, but I doubt it would be easy to write a cad with.
Reply all
Reply to author
Forward
0 new messages