[GRASS-SVN] r32230 - grass/branches/develbranch_6/gui/wxpython

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Jul 23 11:31:27 EDT 2008


Author: martinl
Date: 2008-07-23 11:31:27 -0400 (Wed, 23 Jul 2008)
New Revision: 32230

Modified:
   grass/branches/develbranch_6/gui/wxpython/wxgui.py
Log:
wxGUI: render map when workspace is loaded (merged from trunk, r32229)

Modified: grass/branches/develbranch_6/gui/wxpython/wxgui.py
===================================================================
--- grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-07-23 15:29:10 UTC (rev 32229)
+++ grass/branches/develbranch_6/gui/wxpython/wxgui.py	2008-07-23 15:31:27 UTC (rev 32230)
@@ -162,6 +162,8 @@
             except:
                 pass
 
+        self.Show()
+
         # load workspace file if requested
         if (self.workspaceFile):
             # load given workspace file
@@ -627,29 +629,30 @@
             # start map displays first (list of layers can be empty)
             #
             displayId = 0
+            mapdisplay = []
             for display in gxwXml.displays:
-                mapdisplay = self.NewDisplay(show=False)
+                mapdisplay.append(self.NewDisplay(show=False))
                 maptree = self.gm_cb.GetPage(displayId).maptree
 
                 # set windows properties
-                mapdisplay.SetProperties(render=display['render'],
+                mapdisplay[-1].SetProperties(render=display['render'],
                                          mode=display['mode'],
                                          showCompExtent=display['showCompExtent'])
 
                 # set position and size of map display
                 if UserSettings.Get(group='workspace', key='posDisplay', subkey='enabled') is False:
                     if display['pos']:
-                        mapdisplay.SetPosition(display['pos'])
+                        mapdisplay[-1].SetPosition(display['pos'])
                     if display['size']:
-                        mapdisplay.SetSize(display['size'])
+                        mapdisplay[-1].SetSize(display['size'])
 
                 # set extent if defined
                 if display['extent']:
                     w, s, e, n = display['extent']
                     maptree.Map.region = maptree.Map.GetRegion(w=w, s=s, e=e, n=n)
+                    
+                mapdisplay[-1].Show()
 
-                mapdisplay.Show()
-
                 displayId += 1
     
             maptree = None 
@@ -686,6 +689,9 @@
                 # reverse list of map layers
                 maptree.Map.ReverseListOfLayers()
 
+            for mdisp in mapdisplay:
+                mdisp.MapWindow2D.UpdateMap()
+
             file.close()
         except IOError, err:
             wx.MessageBox(parent=self,



More information about the grass-commit mailing list