Patch from FN that fixes bug in RefreshItem on an item that has no

corresponding node in the tree yet (because its parent isn't expanded
yet) triggered an exception.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45503 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-04-16 18:59:00 +00:00
parent 3a41827a6d
commit 7d36c6a8eb
3 changed files with 38 additions and 50 deletions

View File

@@ -1,10 +1,6 @@
import wx, wx.lib.customtreectrl, wx.gizmos
try:
import treemixin
except ImportError:
from wx.lib.mixins import treemixin
import treemixin
overview = treemixin.__doc__
class TreeModel(object):
''' TreeModel holds the domain objects that are shown in the different
@@ -153,8 +149,8 @@ class VirtualCustomTreeCtrl(DemoTreeMixin,
wx.lib.customtreectrl.CustomTreeCtrl):
def __init__(self, *args, **kwargs):
self.checked = {}
kwargs['ctstyle'] = wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT | \
wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT
kwargs['style'] = wx.TR_HIDE_ROOT | \
wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT
super(VirtualCustomTreeCtrl, self).__init__(*args, **kwargs)
self.Bind(wx.lib.customtreectrl.EVT_TREE_ITEM_CHECKED,
self.OnItemChecked)