List Info

Thread: xrc and WINDOW_CREATE event




xrc and WINDOW_CREATE event
user name
2007-03-28 22:02:49
Dear list,

I'd like to know how you are handling the two step creation
process when using
own derived controls with xrc.
At least on wxGTK in some cases the creation of the window
is delayed until is
becomes visible, e.g. a panel sitting on a notebook page.
This means that you
can't access attributes which are set up in the
WINDOW_CREATE evt handler before
the user makes that window visible. Therefore I just dropped
waiting for the
event and called the handler by hand directly after
self.PostCreate(obj). I was
lucky that it worked for my app which heavily uses xrc both
on linux and
windows. Now however, while building test cases for the
custom xrc based
controls, i.e. a small test application which opens a frame
holding that
control, I encountered problems with that method, more
precisely the test app
segfaults. This happens on the code right after PostCreate,
so this is obviously
due to not waiting for the WINDOW_CREATE event.
So the question to those who are using xrc out there: how do
you handle that issue?

Christian


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org


Re: xrc and WINDOW_CREATE event
user name
2007-03-28 22:59:24
Christian <ckkarthoc.net> wrote:
> So the question to those who are using xrc out there:
how do you
> handle that issue?

I personally don't use XRC, but one method of handling this
particular
issue is through the use of a MVC approach.  Your XRC is the
View, the
Python you write to handle events, etc., is the Controller,
now you just
need to create a Model and use something like wx.lib.pubsub
to handle
the propagation of data between your Model and View.


 - Josiah


------------------------------------------------------------
---------
To unsubscribe, e-mail: wxPython-users-unsubscribelists.wxwidgets.org
For additional commands, e-mail: wxPython-users-helplists.wxwidgets.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )