[ I tried to post this yesterday but did not see it make the list, so
sorry if tis is a duplicate. ]
If I call frame.Destroy() from a threaded shell controlling a wxapp,
the window isn't actually destroyed until it gets the focus, or
another window is created. This appears to be the documented
behavior; from the wxWindow::Destroy docs:
Frames and dialogs are not destroyed immediately when this function
is called -- they are added to a list of windows to be deleted on
idle time, when all the window's events have been processed.
although the behavior seems to depend on the window manager, eg KDE vs
GNOME.
Is there a call to force the window or wx to finish processing the
pending events, so that the window will actually close after the
function call?
Thanks,
John Hunter
Maybe you'll get lucky if you replace frame.Destroy() with
wxCallAfter( frame.Destroy ). I didn't test this, as I never had this
problem myself.
···
On Tue, 24 Aug 2004 06:04:20 -0500, John Hunter <jdhunter@ace.bsd.uchicago.edu> wrote:
[ I tried to post this yesterday but did not see it make the list, so
sorry if tis is a duplicate. ]
If I call frame.Destroy() from a threaded shell controlling a wxapp,
the window isn't actually destroyed until it gets the focus, or
another window is created. This appears to be the documented
behavior; from the wxWindow::Destroy docs:
Frames and dialogs are not destroyed immediately when this function
is called -- they are added to a list of windows to be deleted on
idle time, when all the window's events have been processed.
although the behavior seems to depend on the window manager, eg KDE vs
GNOME.
Is there a call to force the window or wx to finish processing the
pending events, so that the window will actually close after the
function call?
Thanks,
John Hunter
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
--
Bogdan
Try calling wx.GetApp().ProcessIdle() after destroting the window/frame to process all pending events.
/Jean Brouwers
John Hunter wrote:
···
[ I tried to post this yesterday but did not see it make the list, so
sorry if tis is a duplicate. ]
If I call frame.Destroy() from a threaded shell controlling a wxapp,
the window isn't actually destroyed until it gets the focus, or
another window is created. This appears to be the documented
behavior; from the wxWindow::Destroy docs:
Frames and dialogs are not destroyed immediately when this function
is called -- they are added to a list of windows to be deleted on
idle time, when all the window's events have been processed.
although the behavior seems to depend on the window manager, eg KDE vs
GNOME.
Is there a call to force the window or wx to finish processing the
pending events, so that the window will actually close after the
function call?
Thanks,
John Hunter
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Is there a call to force the window or wx to finish processing
>> the pending events, so that the window will actually close
>> after the function call?
> Try wx.WakeUpIdle()
Worked like a charm! Thanks.