[GRASS-SVN] r31021 - grass/branches/releasebranch_6_3/gui/tcltk/gis.m

svn_grass at osgeo.org svn_grass at osgeo.org
Thu Apr 17 06:20:46 EDT 2008


Author: marisn
Date: 2008-04-17 06:20:46 -0400 (Thu, 17 Apr 2008)
New Revision: 31021

Modified:
   grass/branches/releasebranch_6_3/gui/tcltk/gis.m/mapcanvas.tcl
Log:
Fix saving saving current display geometry to named region in gis.m (Ticket #112). Thanks to Ivan Shmakov for help. (merged from trunk)

Modified: grass/branches/releasebranch_6_3/gui/tcltk/gis.m/mapcanvas.tcl
===================================================================
--- grass/branches/releasebranch_6_3/gui/tcltk/gis.m/mapcanvas.tcl	2008-04-17 10:04:09 UTC (rev 31020)
+++ grass/branches/releasebranch_6_3/gui/tcltk/gis.m/mapcanvas.tcl	2008-04-17 10:20:46 UTC (rev 31021)
@@ -25,23 +25,23 @@
 # source $gmpath/maptool.tcl
 
 namespace eval MapCanvas {
-	variable array displayrequest # Indexed by mon, true if it wants to get displayed.
+	variable array displayrequest ;# Indexed by mon, true if it wants to get displayed.
 
 	# Something's modified the canvas or view, indexed by mon.
 	# Degree of modification 0 - none, 1 - zoom, 2 - canvas
 	variable array canmodified
 
-	variable array can # The canvas widgets of the monitors, indexed by mon
-	variable array mapframe # Frame widgets, indexed by mon
-	variable array canvas_w # Width and height of canvas. Indexed by mon
-	variable array canvas_h # mon
-	variable array driver_w # Actual width and height used while drawing / compositing. Indexed by mon
-	variable array driver_h # Actual width and height used while drawing / compositing. Indexed by mon
-	variable array exploremode # Whether or not to change regions to match monitor, indexed by mon
-	variable array map_ind # Indicator widgets, indexed by mon
-	variable array msg # status message, indexed by mon
-	variable b1north # capture north coordinate on clicking mouse
-	variable b1east # capture east coordinate on clicking mouse
+	variable array can ;# The canvas widgets of the monitors, indexed by mon
+	variable array mapframe ;# Frame widgets, indexed by mon
+	variable array canvas_w ;# Width and height of canvas. Indexed by mon
+	variable array canvas_h ;# mon
+	variable array driver_w ;# Actual width and height used while drawing / compositing. Indexed by mon
+	variable array driver_h ;# Actual width and height used while drawing / compositing. Indexed by mon
+	variable array exploremode ;# Whether or not to change regions to match monitor, indexed by mon
+	variable array map_ind ;# Indicator widgets, indexed by mon
+	variable array msg ;# status message, indexed by mon
+	variable b1north ;# capture north coordinate on clicking mouse
+	variable b1east ;# capture east coordinate on clicking mouse
 
 	
 	# zoom box corners indexed by mon
@@ -83,7 +83,7 @@
 	# Their masks
 	variable array masklist 
 
-	global geoentry "" # variable holds path of entry widgets that use coordinates from canvas
+	global geoentry "" ;# variable holds path of entry widgets that use coordinates from canvas
 
 	# Current region and region historys
 	# Indexed by mon, history (1 (current) - zoomhistories), part (n, s, e, w, nsres, ewres, rows, cols).
@@ -1171,7 +1171,7 @@
 	global devnull
 
 	#get current region settings for resolution
-	if {![catch {open [concat "|g.region" "-ugp" $args "2> $devnull"] r} input]} {
+	if {![catch {open [concat "|g.region" "-ugp " "2> $devnull"] r} input]} {
 		while {[gets $input line] >= 0} {
 			if { [regexp -nocase {^([a-z]+)=(.*)$} $line trash key value] } {
 				set parts($key) $value
@@ -1180,10 +1180,12 @@
 		
 		if {[catch {close $input} error]} {
 			GmLib::errmsg $error [G_msg "Error reading current resolution with g.region"]
+			return
 		}
 		
 	} else {
-		puts $input
+		GmLib::errmsg $input [G_msg "Error reading current resolution with g.region"]
+		return
 	}
 
 	#set computational region extents while maintaining current resolution



More information about the grass-commit mailing list