Toasterbox or modal dialog that doesn't take the focus

Hi Mike,

email_popup_v2.py (1.96 KB)

···

On Nov 20, 2007 3:45 PM, Mike Driscoll wrote:

> Mike Driscoll wrote:
>
> > File
> >
> "//server/repl$/Scripts/PythonPackages/Development/zimbra/email_popup_
> > v2.p
> > y", line 108, in close
> > self.parent.Close()
> > File
> "C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\_core.py",
> > line 14305, in __getattr__
> > raise PyDeadObjectError(self.attrStr % self._name)
> > wx._core.PyDeadObjectError: The C++ part of the EmailPopup
> object has
> > been deleted, attribute access no longer allowed.
>
> This means that self.parent has already been destroyed.
>
> --
> Robin Dunn
> Software Craftsman
> http://wxPython.org Java give you jitters? Relax with wxPython!
>
>

Yeah, I know. But for some reason, even though it's destroyed, the program
continues to run. I can see it in Task Manager and IDLE never returns
unless I restart it or kill the process in Task Manager.

I must be doing something wrong. Maybe I'll get hit with a bolt of insight
today.

Please try the attached version and see if it works.

HTH.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Hi Mike,

Thanks for the improvements. That definitely makes it work better. For
some reason, every time I run it, it changes the widget's placement on my
screen. I don't know why it's so much more finicky than a normal frame.

Can you try the attached version and see if it works? I removed the
call of GetSystemMetrics by using the wxWidgets wx.GetDisplaySize()
method, and put the SetPosition call *after* the SetSize call. It
seems to work here.

It also won't let me run it twice in a row. I end up with a traceback:
Traceback (most recent call last):
  File "C:\Documents and Settings\mld\Desktop\email_popup_v2.py", line 60,
in ?
    frame = wx.Frame(None, size=(300,100))
  File "C:\Python24\lib\site-packages\wx-2.8-msw-unicode\wx\_windows.py",
line 501, in __init__
    _windows_.Frame_swiginit(self,_windows_.new_Frame(*args, **kwargs))
PyNoAppError: The wx.App object must be created first!

This one I don't know... I run it from the DOS command line 10 times
and it didn't throw any tracebacks. Maybe you are running from an IDE
which doesn't use external processes to run wxPython apps (i.i.
PythonWin)?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

email_popup_v2.py (1.9 KB)

···

On Nov 20, 2007 8:48 PM, Mike Driscoll wrote: