Browse Source

wxGUI d.mon: Fix launch light-weight wx monitor without toolbars and statusbar (#678)

* also fix loading back toolbar when initialized without it

Co-authored-by: Anna Petrasova <kratochanna@gmail.com>
Tomas Zigo 4 năm trước cách đây
mục cha
commit
50d9dc3ec0

+ 4 - 3
gui/wxpython/mapdisp/frame.py

@@ -1436,12 +1436,13 @@ class MapFrame(SingleMapFrame):
                       constrainRes=False, projection=False, alignExtent=True):
                       constrainRes=False, projection=False, alignExtent=True):
         """Set properies of map display window"""
         """Set properies of map display window"""
         self.mapWindowProperties.autoRender = render
         self.mapWindowProperties.autoRender = render
-        self.statusbarManager.SetMode(mode)
-        self.StatusbarUpdate()
+        if self.statusbarManager:
+            self.statusbarManager.SetMode(mode)
+            self.StatusbarUpdate()
+            self.SetProperty('projection', projection)
         self.mapWindowProperties.showRegion = showCompExtent
         self.mapWindowProperties.showRegion = showCompExtent
         self.mapWindowProperties.alignExtent = alignExtent
         self.mapWindowProperties.alignExtent = alignExtent
         self.mapWindowProperties.resolution = constrainRes
         self.mapWindowProperties.resolution = constrainRes
-        self.SetProperty('projection', projection)
 
 
     def IsStandalone(self):
     def IsStandalone(self):
         """Check if Map display is standalone
         """Check if Map display is standalone

+ 1 - 1
gui/wxpython/mapdisp/main.py

@@ -457,7 +457,7 @@ class DMonGrassInterface(StandaloneGrassInterface):
             action = self._mapframe.RemoveToolbar
             action = self._mapframe.RemoveToolbar
         else:
         else:
             action = self._mapframe.AddToolbar
             action = self._mapframe.AddToolbar
-        toolbars = self._mapframe.GetToolbarNames()
+        toolbars = list(self._mapframe.GetToolbarNames())
         if not toolbars:
         if not toolbars:
             toolbars.append('map')
             toolbars.append('map')
         for toolbar in toolbars:
         for toolbar in toolbars: