From: Michael Gernoth Date: Sat, 18 Dec 2010 00:47:04 +0000 (+0100) Subject: add button to hide mini-map X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/commitdiff_plain/af0a54e36517d64a2528f0e614a3a8f9411084fc?ds=sidebyside add button to hide mini-map --- diff --git a/res/wmap.tcl b/res/wmap.tcl index b497c35..f6504f0 100644 --- a/res/wmap.tcl +++ b/res/wmap.tcl @@ -232,6 +232,30 @@ bind $win.topframe.overlays.m {tk_traverseToMenu %W %A} -value 13\ -command "SetMapState $win 13" +button $win.topframe.hide\ + -text {Hide Map}\ + -font [Font $win Medium]\ + -borderwidth 1\ + -command "HideMap $win" \ + -relief flat +LinkWindow $win.hide $win.topframe.hide +tk_bindForTraversal $win.topframe.hide + +proc HideMap {win} { + pack unpack $win.centerframe + $win.topframe.hide configure \ + -text {Show Map}\ + -command "ShowMap $win" +} + +proc ShowMap {win} { + pack append $win\ + $win.centerframe {top frame center fill} + $win.topframe.hide configure \ + -text {Hide Map}\ + -command "HideMap $win" +} + label $win.topframe.legend\ -bitmap "@images/legendn.xpm" \ -font [Font $win Medium] @@ -240,6 +264,7 @@ LinkWindow $win.legend $win.topframe.legend pack append $win.topframe\ $win.topframe.zones {left frame nw} \ $win.topframe.overlays {left frame nw} \ + $win.topframe.hide {left frame nw} \ $win.topframe.legend {right frame ne} pack append $win\