wx.Notebook has blank pages on Windows

Hi,

first, I must apologize I can’t give small runnable app because it would be too complicated. The problem is related to wx.Notebook class and appears on Windows but not on Linux. As you can see from the screenshot [1] the notebook pages are empty although there should be some controls [2]. Have anyone seen this problem? The page of notebook is a scrolled panel, its parent is the notebook. First notebook is created, then pages and all the controls are created and then they are added to the notebook (I also tried to add pages and before creating controls ). I use my own subclass of wx.Notebook, however it does nothing special (just for accessing the pages by names and not indices.) Surprisingly this issue is related only to wx.Notebook class, I use also wx.ListBook and lib.agw.FlatNotebook and these are ok on Windows. Also I must add that no error appears.

Anyone has an idea what could be wrong?

Thanks,

Anna

[1] Windows: http://osgeo-org.1560.n6.nabble.com/file/n4998104/notebookstyle_windows_basictop.png

[2] Linux: http://osgeo-org.1560.n6.nabble.com/attachment/4997924/0/basicTop.png

Anna,

Hi,

first, I must apologize I can't give small runnable app because it would be
too complicated. The problem is related to wx.Notebook class and appears on
Windows but not on Linux. As you can see from the screenshot [1] the
notebook pages are empty although there should be some controls [2]. Have
anyone seen this problem? The page of notebook is a scrolled panel, its
parent is the notebook. First notebook is created, then pages and all the
controls are created and then they are added to the notebook (I also tried
to add pages and before creating controls ). I use my own subclass of
wx.Notebook, however it does nothing special (just for accessing the pages
by names and not indices.) Surprisingly this issue is related only to
wx.Notebook class, I use also wx.ListBook and lib.agw.FlatNotebook and these
are ok on Windows. Also I must add that no error appears.
Anyone has an idea what could be wrong?

Suggestion/question 1: do the controls appear when you resize the main
frame? If so, try and use a SendSizeEvent() to your main frame upon
startup;

Suggestion 2: try and use the Widget Inspection Tool (WIT):
http://wiki.wxpython.org/Widget%20Inspection%20Tool
It might be a wrong parenting issue, although it would be a bit
strange as wx.ListBook and FlatNotebook both work;

Suggestion 3: progressively cut down your code to try and make a
sample app. I know that sometimes it's very unappealing to do so (and
time consuming as well), but please keep in mind that in 90% of the
cases you will discover the bug yourself while stripping down your
code to create the sample app.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 29 August 2012 18:07, annakrat wrote:

Hi,

I already sent an answer but I cannot see it in the google groups interface. Anyway, I solved it somehow although I’m not fully satisfied because I don’t understand it much.

There was no event.Skip() in the EVT_NOTEBOOK_CHANGED handler. However this caused strange behaviour probably caused by propagating this event somewhere where it shouldn’t be and affecting some other notebook in the application (not platform specific issue). I used event.StopPropagate() which solves the issue.

Best regards,

Anna

Dne středa, 29. srpna 2012 20:21:38 UTC+2 Infinity77 napsal(a):

···

Anna,

On 29 August 2012 18:07, annakrat wrote:

Hi,

first, I must apologize I can’t give small runnable app because it would be

too complicated. The problem is related to wx.Notebook class and appears on

Windows but not on Linux. As you can see from the screenshot [1] the

notebook pages are empty although there should be some controls [2]. Have

anyone seen this problem? The page of notebook is a scrolled panel, its

parent is the notebook. First notebook is created, then pages and all the

controls are created and then they are added to the notebook (I also tried

to add pages and before creating controls ). I use my own subclass of

wx.Notebook, however it does nothing special (just for accessing the pages

by names and not indices.) Surprisingly this issue is related only to

wx.Notebook class, I use also wx.ListBook and lib.agw.FlatNotebook and these

are ok on Windows. Also I must add that no error appears.

Anyone has an idea what could be wrong?

Suggestion/question 1: do the controls appear when you resize the main

frame? If so, try and use a SendSizeEvent() to your main frame upon

startup;

Suggestion 2: try and use the Widget Inspection Tool (WIT):

http://wiki.wxpython.org/Widget%20Inspection%20Tool

It might be a wrong parenting issue, although it would be a bit

strange as wx.ListBook and FlatNotebook both work;

Suggestion 3: progressively cut down your code to try and make a

sample app. I know that sometimes it’s very unappealing to do so (and

time consuming as well), but please keep in mind that in 90% of the

cases you will discover the bug yourself while stripping down your

code to create the sample app.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/

-------------------------------------------------------------

def ask_mailing_list_support(email):

if mention_platform_and_version() and include_sample_app():

    send_message(email)

else:

    install_malware()

    erase_hard_drives()

-------------------------------------------------------------