[wxPython-users] wxScrolledWindow.DestroyChildren() and scrollbars
problem!
Robin Dunn
robin at alldunn.com
Thu Aug 3 10:38:51 PDT 2006
Marcio Moreira wrote:
> My problem is that I need to rebuild the contents of a wxScrolledWindow
> very often on my app. But when I use DestroyChildren to clear the
> ScrollWin, the scrollbars just don't appear after the rebuild of the
> contents.
>
> On the following code, the scrollbars appears, as expected, on the
> ScrolledWindow. But when I click the button, scrollbars disappear.
> What's wrong? Where's my mistake?
>
> I am using Mac OS X 10.3.9, wxPython 2.6.3.3 ANSI and Python 2.3.
>
On wxMac the scrollbars are not "built-in" like on the other platforms,
so they are actual wxScrollBars and are considered children of the
scrolled window. So when you call DestroyChildren() it is nuking the
scrollbars too. So instead of using DestroyChildren you need to loop
over the list returned by GetChildren and Destroy each child that is not
a scrollbar.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list