Hi there. Considering my recent rant on XRC, I think I should at least
say something here.
I don't know the resolution to this (not definitively), however, one
idea does come to mind: Why not call the stage two creation in your
constructor after loading the XRC? It might not be as elegant as having
everything done the way you expect, but it might be enough to work.
I've not got other ideas yet, but I would definitely like to see the
answer. I'm trying to compile docs on XRC as best I can, and get them
posted at the wxPython wiki. So, when you *do* get an answer, please
post it here or on the wiki yourself.
--
Michael J. Pedersen
My IM IDs: Jabber/pede...@icelus.tzo.com, ICQ/103345809, AIM/pedermj022171
Yahoo/pedermj2002, MSN/pederm...@hotmail.com
My GnuPG KeyID: 4E724A60 My Public Key Available At: pgp.mit.edu
My GnuPG Key Fingerprint: C31C 7E90 5992 9E5E 9A02 233D D8DD 985E 4E72 4A60
Are you sure about that? I don't see anything in xh_notbk.cpp that
would force a delayed create, and when loading from XRC the Create
should follow very soon after the instantiation. The EVT_WINDOW_CREATE
event however may not be delivered until later on GTK, but it should
happen right after the MainLoop is started.
Please create a small sample app that shows your problem and somebody
will help you try to diagnose what the real problem is.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
Now, when running the sample app (attached) I noticed that I was partly wrong.
The first stage of the creation is run immediatly but the EVT_WINDOW_CREATE
event is delivered only after the window is shown. Is that to be expected? I
currently cannot access the wxwidgets docs so I cannot read more about the
EVT_WINDOW_CREATE event.
Regards, Christian
I'm not sure if I understand that exactly. Do you say that I should call the 2nd
stage code right after a res.LoadPanel()/LoadFrame() and not use the
EVT_WINDOW_CREATE event? I would prefer not to be obliged to do it that way
since the xrcxml tree has quite a few subclassed members.
Christian
Well, I'll be... This certainly was not expected, not by me anyway.
But it does make sense. On wxGTK the window create event is sent from
the gtk "realize" callback, and apparently gtk is optimizing things for
us by not realizing the widget (IOW, creating its windowing system
resources) until it is shown for the first time.
The only workaround I can think of is to set an attribute in the page
window when its created event is run, and then check for that attribute
in the EVT_NOTEBOOK_PAGE_CHANGED event and react accordingly.