Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.