Fix bug with usage of CustomTreeCtrl method unavailable on wx older versions
authorlaurent
Tue, 11 Oct 2011 12:08:55 +0200
changeset 574 8c525217ef1f
parent 573 0a6b2e1f8ce3
child 575 a7c706b9492e
Fix bug with usage of CustomTreeCtrl method unavailable on wx older versions
SearchResultPanel.py
--- a/SearchResultPanel.py	Tue Oct 11 12:07:04 2011 +0200
+++ b/SearchResultPanel.py	Tue Oct 11 12:08:55 2011 +0200
@@ -86,11 +86,13 @@
         self.HeaderLabel = wx.StaticText(id=ID_SEARCHRESULTPANELHEADERLABEL,
               name='HeaderLabel', parent=self,
               pos=wx.Point(0, 0), size=wx.Size(0, 17), style=0)
-
+        
+        search_results_tree_style = CT.TR_HAS_BUTTONS|CT.TR_NO_LINES|CT.TR_HAS_VARIABLE_ROW_HEIGHT
         self.SearchResultsTree = CT.CustomTreeCtrl(id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE,
               name="SearchResultsTree", parent=self,
-              pos=wx.Point(0, 0), style=0)
-        self.SearchResultsTree.SetAGWWindowStyleFlag(CT.TR_HAS_BUTTONS|CT.TR_NO_LINES|CT.TR_HAS_VARIABLE_ROW_HEIGHT)
+              pos=wx.Point(0, 0), style=search_results_tree_style)
+        if wx.VERSION >= (2, 8, 11):
+            self.SearchResultsTree.SetAGWWindowStyleFlag(search_results_tree_style)
         self.Bind(wx.EVT_TREE_ITEM_ACTIVATED, self.OnSearchResultsTreeItemActivated,
               id=ID_SEARCHRESULTPANELSEARCHRESULTSTREE)