[wxPython-users] wxScrolledWindow.DestroyChildren() and
scrollbars problem!
Marcio Moreira
arqeco at yahoo.com.br
Sat Aug 5 04:51:44 PDT 2006
Thank you very much Robin!
Regards from Brazil
Márcio Moreira
Robin Dunn <robin at alldunn.com> escreveu: 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!
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
---------------------------------
O Yahoo! está de cara nova. Venha conferir!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/20060805/e4e5cb7e/attachment.htm
More information about the wxpython-users
mailing list