Prevent the whole background from being redrawn for out trees. MIGHT fix flicker issues

This commit is contained in:
cncfanatics
2010-08-23 20:09:08 +02:00
parent a696b72d68
commit 64e25ac58f
2 changed files with 13 additions and 1 deletions

View File

@@ -56,7 +56,7 @@ class MarketBrowser(wx.Panel):
vbox.Add(self.splitter, 1, wx.EXPAND)
self.SetSizer(vbox)
self.marketView = wx.TreeCtrl(self.splitter)
self.marketView = MarketTree(self.splitter)
listStyle = wx.LC_REPORT | wx.BORDER_NONE | wx.LC_NO_HEADER | wx.LC_SINGLE_SEL
self.itemView = wx.ListCtrl(self.splitter, style = listStyle)
@@ -244,3 +244,11 @@ class MarketBrowser(wx.Panel):
self.itemView.SortItems(lambda id1, id2: cmp(idNameMap[id1], idNameMap[id2]))
self.itemView.SetColumnWidth(0, wx.LIST_AUTOSIZE)
class MarketTree(wx.TreeCtrl):
def __init__(self, parent):
wx.TreeCtrl.__init__(parent)
def OnEraseBackGround(self, event):
#Prevent flicker by not letting the parent's method get called.
pass

View File

@@ -280,6 +280,10 @@ class ShipView(wx.TreeCtrl):
else:
return cmp(self.GetItemText(treeId1), self.GetItemText(treeId2))
def OnEraseBackGround(self, event):
#Prevent flicker by not letting the parent's method get called.
pass
class ShipMenu(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self, parent)