Installing Gotk3 (Gtk+3) dependencies

Instructions for installing dependencies for GTK+3 for go GUI development. Click the operating system you are using for specific instructions on installing the initial dependencies.

Command+C the following line into terminal:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

This installs homebrew, which is a way of downloading libraries that the GUI development needs.

run the following commands one after the other:

brew install gtk+3
brew install glib
brew install cairo

Try this. I'll update with better instructions once I run it myself. Then continue with the rest

Once the dependencies are installed, proceed entering the following:

go get -tags gtk_3_18 github.com/gotk3/gotk3/gtk

After all these commands complete, you should have all the dependencies necessary for running the Go repo. When you run/build the app, do it using this:

go build -tags gtk_3_18 GUImain.go
go run -tags gtk_3_18 GUImain.go

because the compile time is now significant, it's usually a better idea to use go build instead of go run. Note that because you have to specify these tags, you can no longer use the play button on vscode. You must type in one of the top two commands at a terminal prompt. It will take a while, and there will be a lot of text that comes up, but it should work after the prompt comes back.

If you use go run, the program will automatically start but if you close the program you'll have to recompile it.

If you use go build, the program will not automatically start, but you can run it as many times as you like without recompiling it. If you use go build, after the build process is finished, enter ./GUImain and the program should open.