summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-18 12:37:19 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-18 12:37:19 +0200
commit11a1c2f8d872cb0ef24f093b2f1e042efca186c4 (patch)
treec6db79068e91d0389b83d54e804d70040d3e9d52
parent3f31751d69ee114076e055468fc42cba3e420a85 (diff)
downloadbiomed-11a1c2f8d872cb0ef24f093b2f1e042efca186c4.tar.gz
biomed-11a1c2f8d872cb0ef24f093b2f1e042efca186c4.tar.bz2
biomed-11a1c2f8d872cb0ef24f093b2f1e042efca186c4.zip
Menu item "Save" is now deactivated, if no map is loaded.
-rw-r--r--main.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/main.go b/main.go
index 44c72fd..f334507 100644
--- a/main.go
+++ b/main.go
@@ -16,6 +16,8 @@ type GUI struct {
showbiomes *gtk.CheckButton
fixSnowIce *gtk.CheckButton
+ menuitemSave *gtk.MenuItem
+
statusContext uint
lastStatus string
@@ -38,7 +40,9 @@ func (g *GUI) openWorld(path string) {
dlg.Destroy()
}
- go g.mapw.SetRegion(region)
+ g.menuitemSave.SetSensitive(true)
+
+ g.mapw.SetRegion(region)
}
func (g *GUI) aboutDlg() {
@@ -85,9 +89,10 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar {
fileMenu.Append(quickopenItem)
}
- save := gtk.NewMenuItemWithLabel("Save")
- save.Connect("activate", g.save)
- fileMenu.Append(save)
+ g.menuitemSave = gtk.NewMenuItemWithLabel("Save")
+ g.menuitemSave.Connect("activate", g.save)
+ g.menuitemSave.SetSensitive(false)
+ fileMenu.Append(g.menuitemSave)
quit := gtk.NewMenuItemWithLabel("Quit")
quit.Connect("activate", g.exitApp)