[wxPython-users] "De-coupling" user events

Mark Erbaugh mark at microenh.com
Mon Dec 3 05:46:48 PST 2007


Stephen,

On Sun, 2007-12-02 at 23:48 -0800, Stephen Hansen wrote:
>         What I'd like to do is have the frame that launched the
>         processing
>         appear 'dead', but have other application frames still active.
>         Until the 
>         user dismisses the dialog, the frame that launched the process
>         is
>         'dead', but the user can freely interact with other frames.
> 
> 
> I don't *believe* you can do that via standard "modal" behavior of
> having a 'ShowModal()' block until this new frame is done, but in the
> one situation where I needed something like that, it wasn't too hard
> to simulate.
> 
> 
> * Basically, the first part of the strategy I used to use the
> wx.FRAME_FLOAT_ON_PARENT style in the pseudo-model dialog. 
> * The display method became '.Show(callback=self._ReceiveAnswer)'
> * I made sure to center that dialog over said parent when it was
> launched.
> * On it's launch, I call ".Enable(False)" on the parent of the
> pseudo-modal dialog.
> * When it was ready to return a result, I'd call ".Enable(True)" on
> the parent
> * I'd then call the callback specified on .Show, pass it the results,
> and close the pseudo-modal dialog.
> 
> 
> There might be an easier way, but the above is actually pretty easy.

That sounds like a good approach.

Thanks,
Mark





More information about the wxpython-users mailing list