[wxPython-users] Segmentation Fault on wx.Listbook::DeleteAllPages()

Saketh Bhamidipati saketh.bhamidipati at gmail.com
Mon Aug 14 11:15:48 PDT 2006


On 8/14/06, Felix <felixonta at teleline.es> wrote:
>
> On Mon, 14 Aug 2006 10:19:00 -0700
> Robin Dunn <robin at alldunn.com> wrote:
>
> > There is a bug that doesn't reset the current page index when the pages
> > are deleted, so the next time it tries to access the current page from
> > the empty array it crashes.  It's already been fixed in 2.7, I'll see if
> > it can be backported to 2.6.
>
> It would be great. Thanks Robin.
>
> But, if this is a bug, can you tell me the best way to populate and
> depopulate a Listbook programmaticaly??
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: wxPython-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail: wxPython-users-help at lists.wxwidgets.org
>
> Populating a list is simple enough - you did it in the example you gave.

Depopulating a list can be done in many ways. I don't know if this is the
best one, but it works:

while not myListbook.GetPageCount() =3D=3D 0:
    myListbook.RemovePage(myListbook.GetSelection())

You could also use a for loop.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wxpython-users/attachments/200608=
14/5983f417/attachment.htm


More information about the wxpython-users mailing list