浏览代码

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 年之前
父节点
当前提交
50d9dc3ec0
共有 2 个文件被更改,包括 5 次插入4 次删除
  1. 4 3
      gui/wxpython/mapdisp/frame.py
  2. 1 1
      gui/wxpython/mapdisp/main.py

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

@@ -1436,12 +1436,13 @@ class MapFrame(SingleMapFrame):
                       constrainRes=False, projection=False, alignExtent=True):
         """Set properies of map display window"""
         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.alignExtent = alignExtent
         self.mapWindowProperties.resolution = constrainRes
-        self.SetProperty('projection', projection)
 
     def IsStandalone(self):
         """Check if Map display is standalone

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

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