瀏覽代碼

wxGUI: use FitInside instead of deprecated SetVirtualSizeHints

 * fixes https://trac.osgeo.org/grass/ticket/2028 (SetVirtualSizeHints is deprecated in wxWidgets 2.9)
 * using code from gui_core/goutput.py
 * should be replaced by simple FitInside call in the future


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64635 15284696-431f-4ddb-bdfa-cd5b030d7da7
Vaclav Petras 10 年之前
父節點
當前提交
843472cd71
共有 1 個文件被更改,包括 6 次插入2 次删除
  1. 6 2
      gui/wxpython/dbmgr/base.py

+ 6 - 2
gui/wxpython/dbmgr/base.py

@@ -2891,8 +2891,12 @@ class LayerBook(wx.Notebook):
                       proportion = 2,
                       proportion = 2,
                       flag = wx.TOP | wx.BOTTOM | wx.RIGHT | wx.EXPAND,
                       flag = wx.TOP | wx.BOTTOM | wx.RIGHT | wx.EXPAND,
                       border = 3)
                       border = 3)
-        
-        layerSizer.SetVirtualSizeHints(self.addPanel)
+
+        # SetVirtualSizeHints is deprecated and is
+        # exactly the same as FitInside() in wxWidgets 2.9 and later
+        getattr(layerSizer, 'FitInside',
+                layerSizer.SetVirtualSizeHints)(self.addPanel)
+
         self.addPanel.SetAutoLayout(True)
         self.addPanel.SetAutoLayout(True)
         self.addPanel.SetSizer(pageSizer)
         self.addPanel.SetSizer(pageSizer)
         pageSizer.Fit(self.addPanel)
         pageSizer.Fit(self.addPanel)