--- grass-6.2.0RC3/gui/tcltk/gis.m/maptool.tcl	2006-09-19 00:38:39.000000000 +1200
+++ grass63/gui/tcltk/gis.m/maptool.tcl	2006-10-29 16:48:31.000000000 +1300
@@ -20,7 +20,7 @@
 proc MapToolBar::create { tb } {
 	global bgcolor
 	global mon
-	global env
+	global env tk_version
 	global iconpath
 	variable toolbar
 	variable maptools
@@ -65,43 +65,84 @@
 	set sep1 [Separator $toolbar.sep1 -orient vertical -background $bgcolor ]
 	pack $sep1 -side left -fill y -padx 5 -anchor w
 
+
 	# DISPLAY TOOLS
 
-	# pointer
-	set pointer [radiobutton $tb.pointer \
+	# -offrelief and -overrelief only exist in Tcl8.4+
+	if {$tk_version < 8.4} {
+	    # pointer
+	    set pointer [radiobutton $tb.pointer \
+		-image [image create photo -file "$iconpath/gui-pointer.gif"] \
+		-command "MapCanvas::stoptool $mon; MapCanvas::pointer $mon" \
+		-variable maptools($mon) -value pointer  -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor  ]
+	    DynamicHelp::register $pointer balloon [G_msg "Pointer"]
+
+	    # zoom in
+	    set zoomin [radiobutton $tb.zoomin \
+		-image [image create photo -file "$iconpath/gui-zoom_in.gif"] \
+		-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon 1" \
+		-variable maptools($mon) -value zoomin -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $zoomin balloon [G_msg "Zoom In"]
+
+	    #zoom out
+	    set zoomout [radiobutton $tb.zoomout \
+		-image [image create photo -file "$iconpath/gui-zoom_out.gif"] \
+		-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon -1" \
+		-variable maptools($mon) -value zoomout  -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $zoomout balloon [G_msg "Zoom Out"]
+
+	    # pan
+	    set pan [radiobutton $tb.pan \
+		-image [image create photo -file "$iconpath/gui-pan.gif"] \
+		-command "MapCanvas::stoptool $mon; MapCanvas::panbind $mon" \
+		-variable maptools($mon) -value pan  -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $pan balloon [G_msg "Pan"]
+
+	} else {
+	    # pointer
+	    set pointer [radiobutton $tb.pointer \
 		-image [image create photo -file "$iconpath/gui-pointer.gif"] \
 		-command "MapCanvas::stoptool $mon; MapCanvas::pointer $mon" \
 		-variable maptools($mon) -value pointer  -relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor  ]
-	DynamicHelp::register $pointer balloon [G_msg "Pointer"]
+	    DynamicHelp::register $pointer balloon [G_msg "Pointer"]
 
-	# zoom in
-	set zoomin [radiobutton $tb.zoomin \
+	    # zoom in
+	    set zoomin [radiobutton $tb.zoomin \
 		-image [image create photo -file "$iconpath/gui-zoom_in.gif"] \
 		-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon 1" \
 		-variable maptools($mon) -value zoomin -relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $zoomin balloon [G_msg "Zoom In"]
+	    DynamicHelp::register $zoomin balloon [G_msg "Zoom In"]
 
-	#zoom out
-	set zoomout [radiobutton $tb.zoomout \
+	    #zoom out
+	    set zoomout [radiobutton $tb.zoomout \
 		-image [image create photo -file "$iconpath/gui-zoom_out.gif"] \
 		-command "MapCanvas::stoptool $mon; MapCanvas::zoombind $mon -1" \
 		-variable maptools($mon) -value zoomout  -relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $zoomout balloon [G_msg "Zoom Out"]
+	    DynamicHelp::register $zoomout balloon [G_msg "Zoom Out"]
 
-	# pan
-	set pan [radiobutton $tb.pan \
+	    # pan
+	    set pan [radiobutton $tb.pan \
 		-image [image create photo -file "$iconpath/gui-pan.gif"] \
 		-command "MapCanvas::stoptool $mon; MapCanvas::panbind $mon" \
 		-variable maptools($mon) -value pan  -relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $pan balloon [G_msg "Pan"]
+	    DynamicHelp::register $pan balloon [G_msg "Pan"]
+	}
 
 	pack $pointer $zoomin $zoomout $pan -side left -anchor w
 
@@ -133,27 +174,21 @@
 	set zdimg [image create photo -file "$iconpath/gui-zoom_default.gif"]
 
 	$zoommenu add command \
-		-compound top \
 		-label {Zoom to selected map} \
 		-command {MapCanvas::zoom_map $mon}
 	$zoommenu add command \
-		-compound right \
 		-label {Zoom to saved region} \
 		-command {MapCanvas::zoom_region $mon}
 	$zoommenu add command \
-		-compound center \
 		-label {Save display geometry to named region} \
 		-command {MapCanvas::save_region $mon}
 	$zoommenu add command \
-		-compound center \
 		-label {Zoom to current region (set with g.region)} \
 		-command {MapCanvas::zoom_current $mon}
 	$zoommenu add command \
-		-compound center \
 		-label {Zoom to default region} \
 		-command {MapCanvas::zoom_default $mon}
 	$zoommenu add command \
-		-compound center \
 		-label {Set current region (WIND file) to match display} \
 		-command {MapCanvas::set_wind $mon "" 0}
 
@@ -166,23 +201,46 @@
 	set sep3 [Separator $toolbar.sep3 -orient vertical -background $bgcolor ]
 	pack $sep3 -side left -fill y -padx 5 -anchor w
 
-	# query
-	set query [radiobutton $tb.query \
+
+	# -offrelief and -overrelief only exist in Tcl8.4+
+	if {$tk_version < 8.4} {
+	    # query
+	    set query [radiobutton $tb.query \
+		-image [image create photo -file "$iconpath/gui-query.gif"] \
+		-command "MapCanvas::stoptool $mon; MapCanvas::querybind $mon" \
+		-variable maptools($mon) -value query	 -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $query balloon [G_msg "Query"]
+
+	    # measure
+	    set measure [radiobutton $tb.measure \
+		-image [image create photo -file "$iconpath/gui-measure.gif"]  \
+		-command "MapCanvas::stoptool $mon; MapCanvas::measurebind $mon"\
+		-variable maptools($mon) -value measure -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $measure balloon [G_msg "Measure"]
+
+	} else {
+	    # query
+	    set query [radiobutton $tb.query \
 		-image [image create photo -file "$iconpath/gui-query.gif"] \
 		-command "MapCanvas::stoptool $mon; MapCanvas::querybind $mon" \
 		-variable maptools($mon) -value query	 -relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $query balloon [G_msg "Query"]
+	    DynamicHelp::register $query balloon [G_msg "Query"]
 
-	# measure
-	set measure [radiobutton $tb.measure \
+	    # measure
+	    set measure [radiobutton $tb.measure \
 		-image [image create photo -file "$iconpath/gui-measure.gif"]  \
 		-command "MapCanvas::stoptool $mon; MapCanvas::measurebind $mon"\
 		-variable maptools($mon) -value measure -relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $measure balloon [G_msg "Measure"]
+	    DynamicHelp::register $measure balloon [G_msg "Measure"]
+	}
 
 	set bbox3 [ButtonBox $toolbar.bbox3 -spacing 0 ]
 	$bbox3 add -image [image create photo -file "$iconpath/gui-profile.gif"] \
@@ -243,29 +301,54 @@
 	set sep5 [Separator $toolbar.sep5 -orient vertical ]
 	pack $sep5 -side left -fill y -padx 5 -anchor w
 
+
 	# Render modes
 
-	# Strict render mode
-	# Uses previous resolution and exact boundaries
-	set strictdraw [radiobutton $tb.strictdraw \
+	# -offrelief and -overrelief only exist in Tcl8.4+
+	if {$tk_version < 8.4} {
+	    # Strict render mode
+	    # Uses previous resolution and exact boundaries
+	    set strictdraw [radiobutton $tb.strictdraw \
+		-command "MapCanvas::exploremode $mon 0" \
+		-variable MapToolBar::explore($mon) -value strict -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $strictdraw balloon [G_msg "Constrain map to region geometry"]
+	    icon_configure $strictdraw drawmode strict
+
+	    # Explore render mode
+	    # Uses resolution to match display and expanded boundaries to fill display
+	    set exploredraw [radiobutton $tb.strictzoom \
+		-command "MapCanvas::exploremode $mon 1" \
+		-variable MapToolBar::explore($mon) -value explore -relief flat \
+		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
+		-activebackground $bgcolor -highlightbackground $bgcolor ]
+	    DynamicHelp::register $exploredraw balloon [G_msg "Map fills display window"]
+	    icon_configure $exploredraw drawmode explore
+
+	} else {
+	    # Strict render mode
+	    # Uses previous resolution and exact boundaries
+	    set strictdraw [radiobutton $tb.strictdraw \
 		-command "MapCanvas::exploremode $mon 0" \
 		-variable MapToolBar::explore($mon) -value strict \
 		-relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $strictdraw balloon [G_msg "Constrain map to region geometry"]
-	icon_configure $strictdraw drawmode strict
+	    DynamicHelp::register $strictdraw balloon [G_msg "Constrain map to region geometry"]
+	    icon_configure $strictdraw drawmode strict
 
-	# Explore render mode
-	# Uses resolution to match display and expanded boundaries to fill display
-	set exploredraw [radiobutton $tb.strictzoom \
+	    # Explore render mode
+	    # Uses resolution to match display and expanded boundaries to fill display
+	    set exploredraw [radiobutton $tb.strictzoom \
 		-command "MapCanvas::exploremode $mon 1" \
 		-variable MapToolBar::explore($mon) -value explore \
 		-relief flat -offrelief flat -overrelief raised \
 		-borderwidth 1 -indicatoron false -bg $bgcolor -selectcolor $selclr \
 		-activebackground $bgcolor -highlightbackground $bgcolor ]
-	DynamicHelp::register $exploredraw balloon [G_msg "Map fills display window"]
-	icon_configure $exploredraw drawmode explore
+	    DynamicHelp::register $exploredraw balloon [G_msg "Map fills display window"]
+	    icon_configure $exploredraw drawmode explore
+	}
 
 	# This does not actually set the mode
 	# it just starts visually in sync with the default
