[Assorted-commits] SF.net SVN: assorted:[1051] sandbox/trunk/src/py/wxraise.py
Brought to you by:
yangzhang
From: <yan...@us...> - 2008-11-03 19:25:23
|
Revision: 1051 http://assorted.svn.sourceforge.net/assorted/?rev=1051&view=rev Author: yangzhang Date: 2008-11-03 17:44:13 +0000 (Mon, 03 Nov 2008) Log Message: ----------- added demo of wx raise quirk Added Paths: ----------- sandbox/trunk/src/py/wxraise.py Added: sandbox/trunk/src/py/wxraise.py =================================================================== --- sandbox/trunk/src/py/wxraise.py (rev 0) +++ sandbox/trunk/src/py/wxraise.py 2008-11-03 17:44:13 UTC (rev 1051) @@ -0,0 +1,27 @@ +# Demo of some quirky behavior in wx: sometimes newly created-and-shown windows +# do not get focus, despite the documentation saying: +# +# "You may need to call Raise for a top level window if you want to bring it to +# top, although this is not needed if Show is called immediately after the +# frame creation." +# +# <http://wxpython.org/docs/api/wx.Window-class.html#Show> + +import wx + +def h(e): + global f + f.Destroy() + f = wx.Frame(None) + f.Show() + f.Raise() + f.SetFocus() + f.Bind(wx.EVT_CLOSE, h) + +app = wx.App() +f = wx.Frame(None) +f.Show() +f.Raise() +f.SetFocus() +f.Bind(wx.EVT_CLOSE, h) +app.MainLoop() This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |