Closing top level windows
-JM
jm at apostle.se
Mon Dec 11 00:11:26 PST 2006
On 2006-12-09, at 15.38, Klaas Holwerda wrote:
> So you first detach the model from the window,
> and Destroy the view its window or if wanted, reuse it for a next
> document that will be opened.
> The view can live with a document that is NULL, it will not show
> anything, and you can Destroy it whenever you want,
> and destroying the document directly after detachment, is not a
> problem.
I understand that, and that's exactly what I'm trying to avoid. It
simply feels very natural to attach the view to the model in the views
ctor, and detach it in its dtor. Doing things this way means that the
view never have to exist without its model. Designing the view so that
it can live without its model is of course possible, but seem like an
unnecessary complication to me. I think it would make more sense to
have a method that can close and dispose of the view (window)
synchronously. I can't think of any other UI framework that does *not*
provide a clean way to close windows at will, without having them
lingering around, receveing (concievably) all kinds of messages they're
supposed to handle cleanly.
So, my initial question remains. Is it possible to accomplish a
"synchronous" window close and dispose action? Possibly by calling
Yield() of some kind in the midle until the window receives its
callback to eventually be disposed?
-JM
More information about the wx-users
mailing list