Subject:
[wxpython-users] Frame without focus - notification window
From:
Bernd Kreuss <bernd_kreuss@gmx.net>
Date:
Sat, 19 Apr 2008 19:55:16 +0200
To:
wxpython-users@lists.wxwidgets.org
To:
wxpython-users@lists.wxwidgets.org
Hello,
is it possible to create and show a Frame that will not automatically
take the focus? I have tried Enabled(False) before I call Show() but
this has no effect (at least on wxGTK) or is there something I can do on
EVT_ACTIVATE to give the focus back to where it came from?
I want to notify the user about an event with a small popup, like for
example E-Mail and IM-clients do. I would prefer a solution that relies
only on wx, no native API-calls into the desktop-environment.
TIA,
Bernd
Andrea Gavana has a cool ToasterBox that can probably work for you:
http://xoomer.alice.it/infinity77/main/ToasterBox.html
I haven't used it yet, but I'd like to as my current solution doesn't work very well. There's also the wx.PopupWindow widget.
Hope that helps!
Mike
Mike Driscoll wrote:
Andrea Gavana has a cool ToasterBox that can probably work for you:
http://xoomer.alice.it/infinity77/main/ToasterBox.html
Thanks for your input. This looks quite nice. He is using a wx.Frame. I
have to study the code to understand exactly whats going on and if (and
how) the problem with the focus is being handled.
I haven't used it yet, but I'd like to as my current solution doesn't
work very well. There's also the wx.PopupWindow widget.
I am currently experimenting with wx.PopupWindow and so far it looks
very good. On one windows XP installation it doesn't steal the focus and
on another one it does (wtf?). But from what I have read now
wxPopupWindow is supposed to do what I want.
There are so many different window classes in wxPython and not much or
no documentation about what they are actually used for.
Bernd
Bernd,
Mike Driscoll wrote:
Andrea Gavana has a cool ToasterBox that can probably work for you:
http://xoomer.alice.it/infinity77/main/ToasterBox.html
Thanks for your input. This looks quite nice. He is using a wx.Frame. I
have to study the code to understand exactly whats going on and if (and
how) the problem with the focus is being handled.
I haven't used it yet, but I'd like to as my current solution doesn't work very well. There's also the wx.PopupWindow widget.
I am currently experimenting with wx.PopupWindow and so far it looks
very good. On one windows XP installation it doesn't steal the focus and
on another one it does (wtf?). But from what I have read now
wxPopupWindow is supposed to do what I want.
Yeah, I have the same issue. On my development PC, the PopupWindow class is stealing the focus. I actually use a method similar to Andrea in that I use a frame for my popup. However, it sometimes grabs the focus and sometimes doesn't. I still can't figure that out, but only one of my users has pointed out the issue.
There are so many different window classes in wxPython and not much or
no documentation about what they are actually used for.
Bernd
I suggest getting the wxPython in Action book by Robin Dunn. It helped me a lot in understanding all the basic widgets. Then the wxPython wiki helped flesh out some of the ones not covered in the book (or not covered well). I should probably experiment with the ones I don't understand until I "get" them and then add to the wiki.
Mike