Kirix Support Forums

wxAuiNotebook in limbo after closing last page

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxAuiNotebook in limbo after closing last page

Postby Remdul on Thu Oct 29, 2009 10:26 am

Hi,

I use wxAuiNotebook in my application, and overall it works great, but I've found a problem.

When my app starts, there are no pages on in the notebook. The panel is gray and no tab buttons are shown. This all behaves as expected.
I can add pages to the notebook, tab buttons appear and all works as expected. I can close pages via the close buttons and manually, and all still works.

However when I close the last page, the notebook control enters a state of limbo. The last page is correctly deleted (the destructor is triggered). The visuals remain unchanged, dragging other windows over the notebook area produces a messy trail of pixels (aka 'garbage'); the notebook window buffer has become corrupted.

Now, by adding a new page again, correct behavior is somewhat restored. The page tab strip and the page content is drawn correctly again. Clicking the button that shows the menu list of pages (::ShowWindowMenu) is fully functional, but the page tab buttons themselves are not. Clicking on the tab button does noting, and they cannot be dragged (to change their order). Clicking the tab close on a page will now crash the program (inside wxAuiNotebook::OnTabButton), and if more than one page are present it also seems to cause a crash merely by hovering the mouse pointer over it.

So in short, all works fine until the last page is closed, after that, weird stuff happens.

The same does not occur in the "aui" sample program, so it seems to be a problem with my code. The control I insert into the page is a custom class that is derived from wxTextCtrl. The destructor is called when the last page is closed. I don't do anything fancy in this derived class, it only holds an extra few variables and helper functions (i.e. doesn't interfere with typical wx functions).

I'm hoping someone can point me in the right direction. I can post code if needed (it's a bit large and scattered).

Thanks!

Windows XP / MSVC2005E / wxWidgets-2.8.7 and 2.8.10
Remdul
Registered User
 
Posts: 1
Joined: Thu Oct 29, 2009 9:13 am

Return to wxAUI Questions, Thoughts & Feedback