Re: How to install gio?

Message ID
DKIM signature
Download raw message
On Fri Feb 28, 2020 at 16:44, Thierry Pfeiffer wrote:
> Hi Elias,
> I want to test gio but I don't know how to install the library. It seems a
> very promising concept.
> I tried "go get git.sr.ht/~eliasnaur/gio" but it doesn't work. Can you
> help? Link to doc?
> (I'm learning Golang only for few months)

Certainly. I believe the confusion arises because there is no "go get" step if
you're using Go modules, and that the correct import path for Gio packages are
on the form "gioui.org/...", not "git.sr.ht/...".

Depending on your operating system, you may need to install libraries and
tools. See


With that in place, literally following the "Running Gio programs" section on the
gioui.org frontpage should result in a running Gio program. In particular, starting
with an empty directory:

	$ go mod init example.com
	$ go run gioui.org/example/kitchen

I assume you have the "go" tool in your $PATH (or %PATH%).

If that works for you, try copying one of the examples from Gio. For example,


into your directory and run

	$ go run .

If that works, you can edit kitchen.go program to experiment with Gio.

More information:

Gio examples: https://git.sr.ht/~eliasnaur/gio/tree/master/example
An immediate mode primer: https://eliasnaur.com/blog/immediate-mode-gui-programming
Gophercon UK talk: https://youtube.com/watch?v=PxnL3-Sex3o
Package docs: https://pkg.go.dev/mod/gioui.org
#gioui Slack channel: https://gophers.slack.com

If you're a beginner, I recommend the #gioui Slack channel which is full
of helpful people. And myself, of course :)

-- elias