浏览代码

wxGUI: fix CTreeView for wxPython 2.8.10.1 (no agwStyle)

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@55606 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 12 年之前
父节点
当前提交
5f566fa090
共有 1 个文件被更改,包括 9 次插入3 次删除
  1. 9 3
      gui/wxpython/gui_core/treeview.py

+ 9 - 3
gui/wxpython/gui_core/treeview.py

@@ -27,6 +27,7 @@ import wx.gizmos as gizmos
 if __name__ == '__main__':
     sys.path.append(os.path.join(os.environ['GISBASE'], "etc", "gui", "wxpython"))
 
+from core.globalvar import hasAgw
 from core.treemodel import TreeModel, DictNode
 
 from grass.pydispatch.signal import Signal
@@ -124,9 +125,14 @@ class TreeView(AbstractTreeViewMixin, wx.TreeCtrl):
 class CTreeView(AbstractTreeViewMixin, CT.CustomTreeCtrl):
     """!Tree view class inheriting from wx.TreeCtrl"""
     def __init__(self, model, parent, **kw):
-        if 'agwStyle' not in kw:
-            kw['agwStyle'] = CT.TR_HIDE_ROOT | CT.TR_FULL_ROW_HIGHLIGHT |\
-                             CT.TR_HAS_BUTTONS | CT.TR_LINES_AT_ROOT | CT.TR_SINGLE
+        if hasAgw:
+            style = 'agwStyle'
+        else:
+            style = 'style'
+        
+        if style not in kw:
+            kw[style] = CT.TR_HIDE_ROOT | CT.TR_FULL_ROW_HIGHLIGHT |\
+                CT.TR_HAS_BUTTONS | CT.TR_LINES_AT_ROOT | CT.TR_SINGLE
         super(CTreeView, self).__init__(parent=parent, model=model, **kw)
         
 class TreeListView(AbstractTreeViewMixin, ExpansionState, gizmos.TreeListCtrl):