diff --git a/wx/lib/agw/customtreectrl.py b/wx/lib/agw/customtreectrl.py index 06d9aaf0..0315aeb0 100644 --- a/wx/lib/agw/customtreectrl.py +++ b/wx/lib/agw/customtreectrl.py @@ -1961,9 +1961,9 @@ class GenericTreeItem(object): self._width = size.GetWidth() self._windowsize = size - # We don't show the window if the item is collapsed - if not self.IsExpanded(): - self._wnd.Show(False) + ## Hide the window since the position isn't correct yet. It will + ## be shown and positioned when the item is painted. + wnd.Show(False) # The window is enabled only if the item is enabled self._wnd.Enable(self._enabled) diff --git a/wx/lib/agw/hypertreelist.py b/wx/lib/agw/hypertreelist.py index bd1ef417..82f2649d 100644 --- a/wx/lib/agw/hypertreelist.py +++ b/wx/lib/agw/hypertreelist.py @@ -1669,9 +1669,9 @@ class TreeListItem(GenericTreeItem): # Do better strategies exist? wnd.Bind(wx.EVT_SET_FOCUS, self.OnSetFocus) - # We don't show the window if the item is collapsed - if not self.IsExpanded(): - wnd.Show(False) + ## Hide the window since the position isn't correct yet. It will + ## be shown and positioned when the item is painted. + wnd.Show(False) # The window is enabled only if the item is enabled wnd.Enable(self._enabled)