diff options
author | Kevin Chabowski <kevin@kch42.de> | 2013-08-18 12:37:19 +0200 |
---|---|---|
committer | Kevin Chabowski <kevin@kch42.de> | 2013-08-18 12:37:19 +0200 |
commit | 11a1c2f8d872cb0ef24f093b2f1e042efca186c4 (patch) | |
tree | c6db79068e91d0389b83d54e804d70040d3e9d52 | |
parent | 3f31751d69ee114076e055468fc42cba3e420a85 (diff) | |
download | biomed-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.go | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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) |