I am using Choicebook in my app, but the way I'm using it involves a single actual wxChoicebook object that I use DeleteAllPages() and then AddPage() to add the new pages depending on a selection in a list.
What I found is that when you call DeleteAllPages(), the m_selection member doesn't get reset. This means that after I have added my new pages, and I go to set the current page using SetSelection() I get an assert about an invalid page (and the resulting horrible behavior if I ignore it).
I added a line in wxChoicebook::DeleteAllPages() that will reset the selection also (choicbkg.cpp:402):
m_selection = wxNOT_FOUND;
This works great for me, and seems to have no side effects. Does anyone have a better idea? Would this make sense to get included into the source tree?
Thanks
-robin
Possible bug in Choicebook
- ABX
- Can't get richer than this
- Posts: 810
- Joined: Mon Sep 06, 2004 1:43 pm
- Location: Poznan, Poland
- Contact:
Re: Possible bug in Choicebook
Great to know my addition is actually in use. I introduced it mainly as replacement of wxNotebook on small screens of smartphonesrex666 wrote:I am using Choicebook in my app, but the way I'm using it involves a single actual wxChoicebook object that I use DeleteAllPages() and then AddPage() to add the new pages depending on a selection in a list.

Could you please do a minimal addition to minimal sample which duplicates the problem and add it to bug tracker and assign to me (abxabx) ?rex666 wrote:I get an assert about an invalid page
Thanks in advance, ABX
CVS Head, 2.8.X
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2
wxMSW, wxWinCE, wxPalmOS, wxOS2, wxMGL, bakefile
gcc 3.2.3, bcc 5.51, dmc 8.48, ow 1.6, vc 7.1, evc 3/4, pods 1.2