[GRASS-SVN] r65303 - grass/trunk/gui/wxpython/mapdisp

svn_grass at osgeo.org svn_grass at osgeo.org
Thu May 21 13:03:06 PDT 2015


Author: martinl
Date: 2015-05-21 13:03:06 -0700 (Thu, 21 May 2015)
New Revision: 65303

Modified:
   grass/trunk/gui/wxpython/mapdisp/main.py
Log:
wxGUI:  d.mon: input file has incorrect dimensions  (#2680)

Modified: grass/trunk/gui/wxpython/mapdisp/main.py
===================================================================
--- grass/trunk/gui/wxpython/mapdisp/main.py	2015-05-21 17:51:29 UTC (rev 65302)
+++ grass/trunk/gui/wxpython/mapdisp/main.py	2015-05-21 20:03:06 UTC (rev 65303)
@@ -30,6 +30,7 @@
 import sys
 import time
 import shutil
+import fileinput
 
 from core          import globalvar
 import wx
@@ -387,7 +388,19 @@
         layers = self.MapWindow.GetMap().GetListOfLayers()
         self.MapWindow.ZoomToMap(layers = layers)
         
+    def OnSize(self, event):
+        super(DMonFrame, self).OnSize(event)
 
+        # update env file
+        width, height = self.MapWindow.GetClientSize()
+        for line in fileinput.input(monFile['env'], inplace=True):
+            if 'GRASS_RENDER_WIDTH' in line:
+                print 'GRASS_RENDER_WIDTH={}'.format(width)
+            elif 'GRASS_RENDER_HEIGHT' in line:
+                print 'GRASS_RENDER_HEIGHT={}'.format(height)
+            else:
+                print line.rstrip('\n')
+    
 class MapApp(wx.App):
     def OnInit(self):
         if not globalvar.CheckWxVersion([2, 9]):



More information about the grass-commit mailing list