[GRASS-SVN] r52638 - grass/trunk/gui/wxpython/swipe

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 12 07:44:58 PDT 2012


Author: annakrat
Date: 2012-08-12 07:44:57 -0700 (Sun, 12 Aug 2012)
New Revision: 52638

Modified:
   grass/trunk/gui/wxpython/swipe/frame.py
Log:
wxGUI/swipe: move code from OnSize to OnIdle, cosmetics

Modified: grass/trunk/gui/wxpython/swipe/frame.py
===================================================================
--- grass/trunk/gui/wxpython/swipe/frame.py	2012-08-12 14:29:08 UTC (rev 52637)
+++ grass/trunk/gui/wxpython/swipe/frame.py	2012-08-12 14:44:57 UTC (rev 52638)
@@ -61,6 +61,7 @@
         self.Bind(wx.EVT_SIZE, self.OnSize)
         self.Bind(EVT_AUTO_RENDER, self.OnAutoRenderChanged)
         self.Bind(wx.EVT_IDLE, self.OnIdle)
+        self.Bind(wx.EVT_CLOSE, self.OnCloseWindow)
 
         self.SetSize((800, 600))
         
@@ -77,7 +78,8 @@
 
     def CallAfterInit(self):
         self.InitSliderBindings()
-        self.OnSelectRasters(event = None)
+        if not (self.rasters['first'] and self.rasters['second']):
+            self.OnSelectRasters(event = None)
         
     def InitStatusbar(self):
         """!Init statusbar (default items)."""
@@ -158,18 +160,18 @@
     def OnSize(self, event):
         Debug.msg (4, "SwipeMapFrame.OnSize()")
         self.resize = time.clock()
-        w1 = self.GetFirstWindow()
-        w2 = self.GetSecondWindow()
 
-        sizeAll = self.splitter.GetSize()
-        w1.SetClientSize(sizeAll)
-        w2.SetClientSize(sizeAll)
-        
-        w1.OnSize(event)
-        w2.OnSize(event)
-
     def OnIdle(self, event):
         if self.resize and time.clock() - self.resize > 0.2:
+            w1 = self.GetFirstWindow()
+            w2 = self.GetSecondWindow()
+
+            sizeAll = self.splitter.GetSize()
+            w1.SetClientSize(sizeAll)
+            w2.SetClientSize(sizeAll)
+            
+            w1.OnSize(event)
+            w2.OnSize(event)
             self.ResetSlider()
             self.resize = False
 



More information about the grass-commit mailing list