Browse Source

wxGUI: centre dialog on screen/parent before it is show (to avoid flickering), update https://trac.osgeo.org/grass/changeset/32514

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@32519 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 17 years ago
parent
commit
5f75e7af54
1 changed files with 5 additions and 5 deletions
  1. 5 5
      gui/wxpython/gui_modules/menuform.py

+ 5 - 5
gui/wxpython/gui_modules/menuform.py

@@ -1399,6 +1399,7 @@ class GrassGUIApp(wx.App):
 
     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 @@ class GUI:
         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 @@ class GUI:
             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 @@ class GUI:
                      propwin=self.mf)
         
         if show:
+            if self.parent:
+                self.mf.CentreOnParent()
             self.mf.Show(show)
             self.mf.MakeModal(modal)
         else: