From af0a54e36517d64a2528f0e614a3a8f9411084fc Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sat, 18 Dec 2010 01:47:04 +0100 Subject: [PATCH] add button to hide mini-map --- res/wmap.tcl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) 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\ -- 2.39.5