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

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 3 03:54:57 EDT 2011


Author: martinl
Date: 2011-08-03 00:54:57 -0700 (Wed, 03 Aug 2011)
New Revision: 47362

Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/wxnviz.py
Log:
wxNviz: hide GLWindow on exit


Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-08-03 06:45:46 UTC (rev 47361)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2011-08-03 07:54:57 UTC (rev 47362)
@@ -397,6 +397,7 @@
             self.MapWindow3D.UpdateView(None)
         else:
             self.MapWindow = self.MapWindow3D
+            self.MapWindow3D.GetDisplay().Init()
             self.MapWindow3D.UpdateOverlays()
             # add Nviz notebookpage
             self._layerManager.AddNviz()
@@ -495,11 +496,12 @@
             self.statusbar.SetStatusText(_("Please wait, unloading data..."), 0)
             self._layerManager.goutput.WriteCmdLog(_("Switching back to 2D view mode..."),
                                                    switchPage = False)
-            # self.MapWindow3D.UnloadDataLayers(force = True)
+            self.MapWindow3D.UnloadDataLayers(force = True)
             # switch from MapWindowGL to MapWindow
             self._mgr.DetachPane(self.MapWindow3D)
-            self.MapWindow3D.Destroy()
-            self.MapWindow3D = None
+            self.MapWindow3D.Hide()
+            #self.MapWindow3D.Destroy()
+            #self.MapWindow3D = None
             self.MapWindow2D.Show()
             self._mgr.AddPane(self.MapWindow2D, wx.aui.AuiPaneInfo().CentrePane().
                               Dockable(False).BestSize((-1,-1)).

Modified: grass/trunk/gui/wxpython/gui_modules/wxnviz.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2011-08-03 06:45:46 UTC (rev 47361)
+++ grass/trunk/gui/wxpython/gui_modules/wxnviz.py	2011-08-03 07:54:57 UTC (rev 47362)
@@ -76,9 +76,7 @@
         G_set_error_routine(errfunc) 
         G_set_percent_routine(perfunc)
         
-        G_unset_window()
-        GS_libinit()
-        GVL_libinit()
+        self.Init()
         
         self.data_obj = nv_data()
         self.data = pointer(self.data_obj)
@@ -94,6 +92,12 @@
         del self.data
         del self.data_obj
         self.log = None
+
+    def Init(self):
+        """!Initialize window"""
+        G_unset_window()
+        GS_libinit()
+        GVL_libinit()
         
     def ResizeWindow(self, width, height):
         """!GL canvas resized



More information about the grass-commit mailing list