From e70b210ca5ed370214c44c97643eb6d6107c84b6 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Wed, 13 Jan 2016 15:19:55 +0100 Subject: make default window size configurable diff --git a/src/rhlibrary/main.go b/src/rhlibrary/main.go index cbc5deb..a48fd14 100644 --- a/src/rhlibrary/main.go +++ b/src/rhlibrary/main.go @@ -86,7 +86,7 @@ func main() { player, _ := NewPlayer("/home/equinox/helsinki/rivenhell/contrib/rhlibrary/snd") player.Play(1, 1) - mw, err := NewMainWindow() + mw, err := NewMainWindow(640, 360) if err != nil { rhl.Println("Error initilizing Main Window:", err) return diff --git a/src/rhlibrary/mainwindow.go b/src/rhlibrary/mainwindow.go index bfa0ac7..67620df 100644 --- a/src/rhlibrary/mainwindow.go +++ b/src/rhlibrary/mainwindow.go @@ -41,10 +41,8 @@ func (mw *MainWindow) ShowAndRun() { gtk.Main() } -func NewMainWindow() (mw *MainWindow, err error) { +func NewMainWindow(width, height int) (mw *MainWindow, err error) { mw = &MainWindow{} - // Create a new toplevel window, set its title, and connect it to the - // "destroy" signal to exit the GTK main loop when it is destroyed. if mw.win, err = gtk.WindowNew(gtk.WINDOW_TOPLEVEL); err != nil { return } @@ -59,6 +57,6 @@ func NewMainWindow() (mw *MainWindow, err error) { } mw.win.Add(l) - mw.win.SetDefaultSize(800, 600) + mw.win.SetDefaultSize(width, height) return } -- cgit v0.10.2