Skip to content

Instantly share code, notes, and snippets.

@yorickpeterse
Created July 19, 2014 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yorickpeterse/26be465ade329ba4d94b to your computer and use it in GitHub Desktop.
Save yorickpeterse/26be465ade329ba4d94b to your computer and use it in GitHub Desktop.
package main
import (
"github.com/conformal/gotk3/gtk"
"os"
"path"
)
func main() {
gtk.Init(nil)
cwd, err := os.Getwd()
if ( err != nil ) {
panic("Failed to get the current working directory")
}
builder, err := gtk.BuilderNew()
if ( err != nil ) {
panic("Failed to create a new Builder")
}
builder.AddFromFile(path.Join(cwd, "src/sqlgui/views/main_window.glade"))
window, err := builder.GetObject("main_window")
window := window.(*gtk.Window)
if ( window == nil || err != nil ) {
panic("Failed to get the main window. I hate Go error handling")
}
window.ShowAll()
gtk.Main()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment