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:
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?
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'?
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!
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?