summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-17 11:29:11 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-17 11:44:40 +0200
commitf73b991b66a001e2978494fdc7c5bedb8a4c3fbc (patch)
treead25b4cedf4fb66e670b43a6c3fc17dc0094641b
parent8cd7d24da3d2ad3f18b2e86f444d1457874820c0 (diff)
downloadbiomed-f73b991b66a001e2978494fdc7c5bedb8a4c3fbc.tar.gz
biomed-f73b991b66a001e2978494fdc7c5bedb8a4c3fbc.tar.bz2
biomed-f73b991b66a001e2978494fdc7c5bedb8a4c3fbc.zip
Enabled saving
-rw-r--r--main.go5
-rw-r--r--mapwidget.go4
2 files changed, 9 insertions, 0 deletions
diff --git a/main.go b/main.go
index 107ec8f..42135af 100644
--- a/main.go
+++ b/main.go
@@ -83,6 +83,7 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar {
}
save := gtk.NewMenuItemWithLabel("Save")
+ save.Connect("activate", g.save)
fileMenu.Append(save)
quit := gtk.NewMenuItemWithLabel("Quit")
@@ -116,6 +117,10 @@ func (g *GUI) mkMenuBar() *gtk.MenuBar {
return menubar
}
+func (g *GUI) save() {
+ g.mapw.Save()
+}
+
func (g *GUI) mkQuickOpen() (*gtk.Menu, bool) {
maps := allMaps()
if (maps == nil) || (len(maps) == 0) {
diff --git a/mapwidget.go b/mapwidget.go
index 48ae051..e8b23b3 100644
--- a/mapwidget.go
+++ b/mapwidget.go
@@ -329,6 +329,10 @@ func (mw *MapWidget) movement(ctx *glib.CallbackContext) {
mw.mx1, mw.my1 = mw.mx2, mw.my2
}
+func (mw *MapWidget) Save() {
+ mw.tileCmds <- cmdSave
+}
+
func (mw *MapWidget) buttonChanged(ctx *glib.CallbackContext) {
arg := ctx.Args(0)
bev := *(**gdk.EventButton)(unsafe.Pointer(&arg))