summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-01-13 14:19:55 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-01-13 14:19:55 (GMT)
commite70b210ca5ed370214c44c97643eb6d6107c84b6 (patch)
tree2c05ca521fb38e649d0f18374edaaef4eabd0fa6
parentaacbbfa74a912a6ac11eb0400f358f5f1de23356 (diff)
make default window size configurable
-rw-r--r--src/rhlibrary/main.go2
-rw-r--r--src/rhlibrary/mainwindow.go6
2 files changed, 3 insertions, 5 deletions
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
}