[Newbie] wxNotebook contents not showing on MSW

Hi All,

Earlier this month I posted a question about getting a notebook to display on MSW. I created a trivial app that I thought would model my larger app. Unfortunately, it isn't and I still can't get the contents of my wxNotebook to display on MSW (works fine on GTK/Linux).

I use wxDesigner to create the controls whenever possible.

The notebook is created from a subclass I have created. The subclass (ContactsNB) knows how to populate the controls on its pages with data EVT_NOTEBOOK_PAGE_CHANGED where it decides which data to pull from the database.

The notebook is displaying the notebook tabs, but not the contents on the tabs. FWIW, the MSWindows version is calling the EVT_NOTEBOOK_PAGE_CHANGED code when a page is added to the wxNotebook, while in GTK/Linux, that event is not called.

I'm happy to send the list my code, if requested, but there's a lot of it and I don't want to post it unnecessarily.

Is there some fundamental wxParadigm about displaying controls on a subclassed object I'm missing?

TIA,

Eric.

···

from my contacts database. It also registers an event handler for

Hi all,
Sorry for replying to my own post, but by adding a ton of print statements and selectively commenting out portions of my code, I found the culprit. In my subclasses __init__() method I was registering

EVT_NOTEBOOK_PAGE_CHANGED event

commenting this line out resulted in the notebook page controls being displayed. I don't know or understand why, though :frowning:

If any of you can point me to an explanation of why registering an event in a derived wxNotebook class *in ms windows only* should cause problems, I'd sure love to read about it. It's bittersweet to fix a problem without understanding the fix.

Best regards,

Eric.

Eric Walstad wrote:

···

Hi All,

Earlier this month I posted a question about getting a notebook to display on MSW. I created a trivial app that I thought would model my larger app. Unfortunately, it isn't and I still can't get the contents of my wxNotebook to display on MSW (works fine on GTK/Linux).

I use wxDesigner to create the controls whenever possible.

The notebook is created from a subclass I have created. The subclass (ContactsNB) knows how to populate the controls on its pages with data from my contacts database. It also registers an event handler for EVT_NOTEBOOK_PAGE_CHANGED where it decides which data to pull from the database.

The notebook is displaying the notebook tabs, but not the contents on the tabs. FWIW, the MSWindows version is calling the EVT_NOTEBOOK_PAGE_CHANGED code when a page is added to the wxNotebook, while in GTK/Linux, that event is not called.

I'm happy to send the list my code, if requested, but there's a lot of it and I don't want to post it unnecessarily.

Is there some fundamental wxParadigm about displaying controls on a subclassed object I'm missing?

TIA,

Eric.

Eric Walstad wrote:

Hi all,
Sorry for replying to my own post, but by adding a ton of print statements and selectively commenting out portions of my code, I found the culprit. In my subclasses __init__() method I was registering

EVT_NOTEBOOK_PAGE_CHANGED event

commenting this line out resulted in the notebook page controls being displayed. I don't know or understand why, though :frowning:

Probably because there is some default processing in the base class for that event that needs to happen. If you call event.Skip() in your handler then the default handler will still be called.

···

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

Robin Dunn wrote:

Eric Walstad wrote:

Hi all,
Sorry for replying to my own post, but by adding a ton of print statements and selectively commenting out portions of my code, I found the culprit. In my subclasses __init__() method I was registering

EVT_NOTEBOOK_PAGE_CHANGED event

commenting this line out resulted in the notebook page controls being displayed. I don't know or understand why, though :frowning:

Probably because there is some default processing in the base class for that event that needs to happen. If you call event.Skip() in your handler then the default handler will still be called.

That fixed it. Thanks for the enlightenment Robin! -Eric