Bug in wx.Listbook.DeleteAllPages()?

Hi guys,

I think I've found a bug in wxPython version 2.5.1.5. I have a frame
which uses a wx.Listbook to show a list of "partitions" within the
application I'm working on. Within this frame object, I have a
"rebuild" method which looks like this:

    def _rebuildPartitionList(self):
        self.partitionList.DeleteAllPages()

        ...

        for partition in partitions:
            infoPanel = PartitionInfoPanel(self.partitionList, partition)
            self.partitionList.AddPage(infoPanel, partition)

This rebuild method works fine the first time it is called, but when
it is called a second time, the wx.Listbook ends up with two sets of
partitions listed. The old Listbook entries generate an assertion
failure when clicked on, while the new ones work fine.

I tried replacing the call to DeleteAllPages() with:

        for i in range(self.partitionList.GetPageCount()-1, -1, -1):
            self.partitionList.DeletePage(i)

and it works fine no matter how often the rebuild method is called.
So, am I going mad, or is there indeed a bug in the implementation of
wx.Listbook.DeleteAllPages() in wxPython 2.5.1.5?

Thanks,

- Erik.

Erik Westra wrote:

Hi guys,

I think I've found a bug in wxPython version 2.5.1.5.

Yep. I've just fixed it, but you'll need to continue using your workaround until the next release.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Cool. Thanks, Robin -- keep up the great work!

- Erik.

···

On Mon, 23 Aug 2004 15:55:18 -0700, Robin Dunn <robin@alldunn.com> wrote:

Erik Westra wrote:
> Hi guys,
>
> I think I've found a bug in wxPython version 2.5.1.5.

Yep. I've just fixed it, but you'll need to continue using your
workaround until the next release.

Hello,

I binded EVT_LISTBOX_DCLICK so my application is notified when the item is double clicked.
I hoped this event to be emited also when I press Enter, but it's not the case
How to make HtmlListBox 'keyboard friendly'?

Regards,
Rafal

Rafal wrote:

Hello,

I binded EVT_LISTBOX_DCLICK so my application is notified when the item is double clicked.
I hoped this event to be emited also when I press Enter, but it's not the case
How to make HtmlListBox 'keyboard friendly'?

Catch the EVT_KEY_DOWN and if it's Enter then send an event yourself (or just do directly what you need done) and call event.Skip() otherwise.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Robin Dunn wrote:

Rafal wrote:

Hello,

I binded EVT_LISTBOX_DCLICK so my application is notified when the item is double clicked.
I hoped this event to be emited also when I press Enter, but it's not the case
How to make HtmlListBox 'keyboard friendly'?

Catch the EVT_KEY_DOWN and if it's Enter then send an event yourself (or just do directly what you need done) and call event.Skip() otherwise.

I catched EVT_KEY_DOWN. It works.
But I don't know how to send an event myself.
Couldn't find anything relevant in wxWindows manuals. What should I read?

Best regards,
Rafal