Unable To Destroy Wx.Dialog In Wxpython
After launching a process using subprocess.Popen() as shown, I would like to create a busy-window (wx.Dialog) with an 'Abort'-button. This works as intended; however, in the case w
Solution 1:
I think the problem is actually ShowModal
, which won't exit until the user clicks something in the window to make it exit. From the docs:
Shows a modal dialog. Program flow does not return until the dialog has been dismissed with wxDialog::EndModal.
I think ShowModal
is fine and appropriate, but you need to pass the process to the dialog, and the dialog probably needs some kind of periodic checking for the process to complete (perhaps EVT_TIMER
) so that it can close itself and return when the process completes. It will still return the abort code if a user cancels, so you still want to catch that and kill the process if you see that.
Post a Comment for "Unable To Destroy Wx.Dialog In Wxpython"