How to keep a frame always on top of all other windows include other application's windows?
Any help would be appreciated!
Bruce Who
HuXu...@hotmail.com
2005-03-10
It works,and I find this seems only works on Windows,too:
wxSTAY_ON_TOP
Stay on top of all other windows, see also wxFRAME_FLOAT_ON_PARENT. Windows only.
======= 2005-03-10 17:10:27 Peter Damoc wrote: =======
>On Thu, 10 Mar 2005 10:53:18 +0200, Bruce Who <HuXu...@hotmail.com> wrote:
>
>> Peter Damoc:
>>
>> thanks, it works fine. And I wonder is it possible to toggle it?
>> For example:
>>
>> ## make the frame always on top
>> frame.SetAlwaysOnTop(True)
>> ...
>> ## disable it
>> frame.SetAlwaysOnTop(False)
>
>have you tried implementing those methods via wxWindow::SetWindowStyle ?
>look in the wx docs for more info ;)
>
>--
>Peter Damoc
>Warrior Of The Light
>http://www.sigmacore.net/
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wxPython-user...@lists.wxwidgets.org
>For additional commands, e-mail: wxPython-...@lists.wxwidgets.org
>
>.
= = = = = = = = = = = = = = = = = = = =
Bruce Who
HuXu...@hotmail.com
2005-03-10
I tried SetWindowStyle to change the style and it works on WinXP,python23,wxpython2.5.2.8. here is the sample code:
"""
author: Bruce Who
date: 2005-03-10
$Revision$
description: 这个演示了
- 如何动态的改变Frame的style
- 如何使用Frame总在最上
"""
import wx
class myFrame(wx.Frame): # {{{
def __init__(self, parent):
wx.Frame.__init__(self, parent,-1,style=wx.DEFAULT_FRAME_STYLE|wx.STAY_ON_TOP)
self.Bind(wx.EVT_LEFT_UP,self.OnClick) #,self.panel_)
self.flag_ = True
def OnClick(self,evt):
## 改变窗口的样式
if self.flag_:
self.SetWindowStyle(wx.DEFAULT_FRAME_STYLE)
else:
self.SetWindowStyle(wx.DEFAULT_FRAME_STYLE|wx.STAY_ON_TOP)
self.flag_ = not self.flag_
print 'click'
# }}}
def main(): # {{{
app = wx.PySimpleApp(0)
frame = myFrame(None)
frame.Show(True)
app.SetTopWindow(frame)
app.MainLoop()
# }}}
if __name__ == "__main__":main()
======= 2005-03-11 09:53:10 Robin Dunn wrote: =======
>Bruce Who wrote:
>> Peter Damoc:
>>
>> thanks, it works fine. And I wonder is it possible to toggle it?
>> For example:
>>
>> ## make the frame always on top
>> frame.SetAlwaysOnTop(True)
>> ...
>> ## disable it
>> frame.SetAlwaysOnTop(False)
>>
>
>No you would have to recreate the window to change that style.
>
>
>--
>Robin Dunn
>Software Craftsman
>http://wxPython.org Java give you jitters? Relax with wxPython!
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wxPython-user...@lists.wxwidgets.org
>For additional commands, e-mail: wxPython-...@lists.wxwidgets.org
>
>.
= = = = = = = = = = = = = = = = = = = =
Bruce Who
HuXu...@hotmail.com
2005-03-11
>Tim Roberts:
>
> sometimes, a "stay on top" frame is indeed necessary: I don't know whether you know FlashGet, it has a small "stay on top" box(just a 64*64 icon), you can drag hyperlinks from your Explorer to the box, and it downloads the item. It's convenient.
>
But why do I need that to stay on top when I have QuarkXPress running
fullscreen? Then its just wasting real estate. As long as I can keep
that in an upper corner, and make sure Internet Explorer doesn't overlap
it, it wouldn't need to be "stay on top" at all.
I still say this should be MY decision for MY desktop, not the
application designer's decision.
--
- Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.
zxo102:
Is your iewin widget in a frame?
======= 2005-03-15 11:17:43 zxo102 wrote: =======
>Tim Roberts,
>
>Thanks for your reply.
>Here is my situation. This computer lab has 150 desktop ( window xp) for students. There are more than 1000 students to use this lab for computer-related courses. The customer wants to know the following: when a student login and logout, which machine he/she is using, check if he/she is a legal user and assign the user maximum access time (say, 10,000 minutes. if he/she use it up, the user can not login, the python iewin will stay on top and the user can not close it. So the user can not use any computers in this lab anymore).
> I implement an small application and install it on one of the PCs in the same computer lab (use it as a server). All users information are loaded into this small applicat ion. That python iewin (wxPython application) is installed on every computer in this lab. This iewin pops out when a PC turns on. I use the python ping module to check all computers regularly in this lab to see if it is on or off. So I can record the user's logout time. Everything works fine except
> It takes a while (5-7 seconds) for the wxpython iewin (I used py2exe to turn it into binary) to pop out even after window xp is ready for the user to click the icons on the screen. So the user has time to click MS IE icon on the screen. If he/she does so, the wx.STAY_ON_TOP of wxpython iewin does not work anymore. In fact, the wxpython iewin stays behind MS IE.
>
>Any suggestions?
>Thanks for your patient to read this message.
>
>Ouyang
>
>Tim Roberts wrote:
>On Mon, 14 Mar 2005 09:25:01 -0800 (PST), zxo102 wrote:
>
>>Tim Roberts
>> In my case, my application is used for manangment
> ;>of computer lab. My mananger wants to force all users
>>to log into my application via IE browser. So we can
>>record this user's login time. I use iewin of wxPython
>>with wx.STAY_ON_TOP for this urpose. After a user
>>login, that python iewin can be closed. That is why I
>>need wx.STAY_ON_TOP for that purpose. Unfortnately,
>>this wx.STAY_ON_TOP does not work for that case I
>>mentioned before.
>>
>>Any suggestions for how to solve this problem?
>>
>
>I went back to look over your original request, and I'm still a bit
>confused. You are trying to record the log in time for a user, right?
>Why can't you get that from the domain security logs? That surely is a
>more reliable measure.
>
>If all you want to do is control (or monitor) access to web sites, a
>much better method is to use some kind of automatic proxy. The first
>contact thro ugh the proxy would redirect to your login page. After the
>login is registered, the proxy just forwards on to the outside site from
>then on.
>
>This is the same way places like hotels and airports with pay-per-view
>networking do it. Network address translation doesn't work until you
>get registered.
>
>--
>- Tim Roberts, ti...@probo.com
>Providenza & Boekelheide, Inc.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: wxPython-user...@lists.wxwidgets.org
>For additional commands, e-mail: wxPython-...@lists.wxwidgets.org
>
>
>
>---------------------------------
>Do you Yahoo!?
> Make Yahoo! your home page
= = = = = = = = = = = = = = = = = = = =
Bruce Who
HuXu...@hotmail.com
2005-03-15
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-user...@lists.wxwidgets.org
For additional commands, e-mail: wxPython-...@lists.wxwidgets.org