DEV Community

Cover image for Learning Go by examples: part 7 - Create a cross-platform GUI/Desktop app in Go

Learning Go by examples: part 7 - Create a cross-platform GUI/Desktop app in Go

Aurélie Vache on August 25, 2021

In previous articles we created an HTTP REST API server, a CLI, a Bot for Discord and even a game for Nintendo Game Boy Advance. Golang is used a...
Collapse
 
oper profile image
Ilie Soltanici

Fyne is awesome, I’m building all my GUI projects only with fyne. Andrew Is really very helpful in slack.

Collapse
 
aurelievache profile image
Aurélie Vache

Yess, Andrew Williams is very active and take time to help people on Slack :-).

Collapse
 
andydotxyz profile image
Andy Williams

The whole community is excellent! I think in the summer fewer of the core team are around, but the rest of the year people are available to help in Slack or Discord at all hours.

Collapse
 
davidkroell profile image
David Kröll

Very neat artcile - looks awesome at first. Probably trying this framework out soon.

Are there productive apps built with Fyne already out there?

Collapse
 
andydotxyz profile image
Andy Williams

As well as the app listings there is also a full desktop built using Fyne which is a pretty good demo :).
fyne.io/fynedesk/

Collapse
 
aurelievache profile image
Aurélie Vache

Oh Andrew, you are here? ^^
Yes of course, the fynedesk demo is a way to see the Fyne possibilities :-).

Collapse
 
aurelievache profile image
Aurélie Vache

Thanks David.
Productive, I don't know, but you can find existing apps done with Fyne here: apps.fyne.io/

Collapse
 
kp52r11 profile image
kp52r11

on Windows 10
Getting this error in command terminal window. no image is displayed in the windows client. Go compiled fine w/o error. Ran go mod tidy also.

2021/12/21 17:57:10 Cause: XML syntax error on line 2: unquoted or missing attribute value in element
2021/12/21 17:57:10 At: c:/go-workspace/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/painter/image.go:55

Collapse
 
energyfish profile image
energyfish

ran the program but keep getting the following error:
Cause: XML syntax error on line 2: unquoted or missing attribute value in element
At: C:/Users/alanh/go/pkg/mod/fyne.io/fyne/v2@v2.1.2/internal/painter/image.go:78

Any help appreciated

Collapse
 
aurelievache profile image
Aurélie Vache

Hi,
I haven't tested on a Windows OS yet.
Have you tried to contact Fyne team members on their slack? :)

Collapse
 
kp52r11 profile image
kp52r11

Here is complete error message.
2021/12/21 18:03:17 Fyne error: SVG Load error:
2021/12/21 18:03:17 Cause: XML syntax error on line 2: unquoted or missing attribute value in element
2021/12/21 18:03:17 At: c:/go-workspace/pkg/mod/fyne.io/fyne/v2@v2.0.4/internal/painter/image.go:55

Collapse
 
buphmin profile image
buphmin

Oh neat! Curious how fyne performs (cpu, ram, etc) compared to electron and similar web based desktop apps 🤔.

Collapse
 
aurelievache profile image
Aurélie Vache

I didn't have compared Fyne with electron, but maybe @andydotxyz already done a benchmark? :-)

Collapse
 
andydotxyz profile image
Andy Williams

I have never done a comparison with web tech - it didn't feel fair as native and web are designed to solve different problems.
A while ago I did start a performance comparison, at github.com/fyne-io/fyne/wiki/Perfo..., I will see if I can add electron and react native to round out the table.
In general a Fyne app may be a little larger (around 7MB or 4MB compressed) because it contains the Go interpreter, but it should run faster with much less RAM required.

Thread Thread
 
buphmin profile image
buphmin

Thanks for the info this is good to know :)

Collapse
 
mjehanno profile image
mJehanno

I'm currently learning Go and I have a side-project where I need to create an API, a mobile App and a discord bot ... and your articles are exactly what I needed ! Many thanks !

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Was about to complain that the stargate was missing earth, but it's right there at the top, just a bit... bent xD

Collapse
 
aurelievache profile image
Aurélie Vache

:-D
Yes don't worry, Gopher can come home ^^

Collapse
 
codeanit profile image
Anit Shrestha Manandhar

Loved the whole series. Thanks.

Collapse
 
aurelievache profile image
Aurélie Vache

Thanks for your comment! :-) :-)

Collapse
 
nigel447 profile image
nigel447

Thanks for a great resource, covers just about everything

Collapse
 
aurelievache profile image
Aurélie Vache

Thanks @nigel447 :-)

Collapse
 
burneyhoel profile image
Burney Hoel

Love the stargate references!

Collapse
 
aurelievache profile image
Aurélie Vache

Ah ah, I love mixing Gophers and movies or TV show; happy you like Stargate reference :-)

Collapse
 
rahulmr profile image
Rahul Raut

Will definitely try this out, great tutorial. Just one question, does it produce a single executable on windows or do we need to provide some dll files?