[GRASS-SVN] r55606 - grass/trunk/gui/wxpython/gui_core

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 3 04:28:15 PDT 2013


Author: martinl
Date: 2013-04-03 04:28:15 -0700 (Wed, 03 Apr 2013)
New Revision: 55606

Modified:
   grass/trunk/gui/wxpython/gui_core/treeview.py
Log:
wxGUI: fix CTreeView for wxPython 2.8.10.1 (no agwStyle)


Modified: grass/trunk/gui/wxpython/gui_core/treeview.py
===================================================================
--- grass/trunk/gui/wxpython/gui_core/treeview.py	2013-04-03 10:57:50 UTC (rev 55605)
+++ grass/trunk/gui/wxpython/gui_core/treeview.py	2013-04-03 11:28:15 UTC (rev 55606)
@@ -27,6 +27,7 @@
 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 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):



More information about the grass-commit mailing list