[GRASS-SVN] r32519 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Mon Aug 4 12:41:14 EDT 2008


Author: martinl
Date: 2008-08-04 12:41:14 -0400 (Mon, 04 Aug 2008)
New Revision: 32519

Modified:
   grass/trunk/gui/wxpython/gui_modules/menuform.py
Log:
wxGUI: centre dialog on screen/parent before it is show (to avoid flickering), update r32514

Modified: grass/trunk/gui/wxpython/gui_modules/menuform.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-08-04 16:34:41 UTC (rev 32518)
+++ grass/trunk/gui/wxpython/gui_modules/menuform.py	2008-08-04 16:41:14 UTC (rev 32519)
@@ -1399,6 +1399,7 @@
 
     def OnInit(self):
         self.mf = mainFrame(parent=None, ID=wx.ID_ANY, task_description=self.grass_task)
+        self.mf.CentreOnScreen()
         self.mf.Show(True)
         self.SetTopWindow(self.mf)
         # print >> sys.stderr, time.time() - start
@@ -1413,7 +1414,7 @@
         self.parent = parent
         self.grass_task = None
 
-    def ParseCommand(self, cmd, gmpath=None, completed=None, parentframe=-1, show=True, modal=False):
+    def ParseCommand(self, cmd, gmpath=None, completed=None, parentframe=None, show=True, modal=False):
         """
         Parse command
 
@@ -1435,10 +1436,7 @@
             if completed[2]:
                 dcmd_params.update(completed[2])
 
-        if parentframe != -1:
-            self.parent = parentframe
-        else:
-            self.parent = None
+        self.parent = parentframe
 
         # parse the interface decription
         self.grass_task = grassTask()
@@ -1491,6 +1489,8 @@
                      propwin=self.mf)
         
         if show:
+            if self.parent:
+                self.mf.CentreOnParent()
             self.mf.Show(show)
             self.mf.MakeModal(modal)
         else:



More information about the grass-commit mailing list