[GRASS-SVN] r32229 - grass/trunk/gui/wxpython

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


Author: martinl
Date: 2008-07-23 11:29:10 -0400 (Wed, 23 Jul 2008)
New Revision: 32229

Modified:
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: render map when workspace is loaded

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2008-07-23 15:15:36 UTC (rev 32228)
+++ grass/trunk/gui/wxpython/wxgui.py	2008-07-23 15:29:10 UTC (rev 32229)
@@ -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 
@@ -687,6 +690,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