Created
July 19, 2014 10:51
-
-
Save yorickpeterse/26be465ade329ba4d94b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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