wx.gizmos.TreeListCtrl sometimes partially blank on gui startup

Hi,

I am stuck on this and am hoping someone might have an suggestion.

I have a gizmos.TreeListCtrl in my gui. Its parent is a
wx.SplitterWindow(). Sometimes when the gui starts up the TreeListCtrl
is partially or fully blank (with the main windows background color).
This happens about 20% of the time. Anyone have any suggestions?

Here is some code if it helps:

···

#############################################################
splitter = wx.SplitterWindow(self, style=wx.SP_LIVE_UPDATE)
self.cmdOutput = wx.TextCtrl(splitter,value='', style=wx.TE_MULTILINE)
TREE_ID = wx.NewId()
self.mainList = FileTree(splitter, self.startDir, id=TREE_ID)
splitter.SplitHorizontally(self.mainList, self.cmdOutput)
sizer_sash_cmdPanel = wx.BoxSizer(wx.VERTICAL)
sizer_sash_cmdPanel.Add(splitter, 1, wx.EXPAND)
. . .
#############################################################
class FileTree(wx.Panel):
    def __init__(self, parent, startPath=os.getcwd(), id=wx.NewId()):
        self.mainWindow=wx.GetTopLevelWindows()[0]
        wx.Panel.__init__(self, parent, id, style=wx.WANTS_CHARS)
        self.Bind(wx.EVT_SIZE, self.OnSize)
        self.tree = gizmos.TreeListCtrl(self, -1,
                    style =
                    #wx.TR_DEFAULT_STYLE
                    wx.TR_FULL_ROW_HIGHLIGHT
                    >wx.TR_MULTIPLE #CRASH: This is causing crash
unless SetCurrentItem is run
                    >wx.TR_TWIST_BUTTONS
                    )
. . .
#############################################################

Does it correct itself if you manually nudge the size of the frame a bit? If so then adding a Layout() call in the init code will probably help it. Otherwise please send a small runnable sample that shows the problem so we can help you with it. MakingSampleApps - wxPyWiki

···

On 2/5/10 5:44 PM, yl wrote:

Hi,

I am stuck on this and am hoping someone might have an suggestion.

I have a gizmos.TreeListCtrl in my gui. Its parent is a
wx.SplitterWindow(). Sometimes when the gui starts up the TreeListCtrl
is partially or fully blank (with the main windows background color).
This happens about 20% of the time. Anyone have any suggestions?

--
Robin Dunn
Software Craftsman

Thanks for getting back to me. I had my .Refresh and .Update calls in
a wx.CallAfter(), and pulling them out seemed to fix the problem (has
not come up again in past 3 weeks). They were in there because every
so often I end up with left garbage items at the bottom of my list.
CallAfter was an attempt to fix that issue. I will add a separate post
for that issue issue.

-yancy

···

On Feb 6, 12:33 pm, Robin Dunn <ro...@alldunn.com> wrote:

On 2/5/10 5:44 PM, yl wrote:

> Hi,

> I am stuck on this and am hoping someone might have an suggestion.

> I have agizmos.TreeListCtrl in my gui. Its parent is a
> wx.SplitterWindow(). Sometimes when the gui starts up the TreeListCtrl
> is partially or fully blank (with the main windows background color).
> This happens about 20% of the time. Anyone have any suggestions?

Does it correct itself if you manually nudge the size of the frame a
bit? If so then adding a Layout() call in the init code will probably
help it. Otherwise please send a small runnable sample that shows the
problem so we can help you with it.MakingSampleApps - wxPyWiki

--
Robin Dunn
Software Craftsmanhttp://wxPython.org