linux 窗口z order,wxPython窗口z-order设置
使用wxpython寫(xiě)的界面程序其實(shí)也是可以設(shè)置Z-order的。
可以使用pywin32模塊調(diào)用win32的API實(shí)現(xiàn),使用方法不在贅述。
如果僅僅是想將窗口置頂(放在其他窗口上面,Z-order頂部),有一個(gè)簡(jiǎn)單的方法:
在wx.Frame中調(diào)用一下這個(gè)方法
self.ToggleWindowStyle(wx.STAY_ON_TOP)
或者
self.SetWindowStyle(wx.STAY_ON_TOP)
注意,wx.Raise()的方法是有限制的,如下的Remark
virtual void wxWindow::Raise() [virtual]
Raises the window to the top of the window hierarchy (Z-order).
Notice that this function only requests the window manager to raise this window to the top of Z-order.
Depending on its configuration, the window manager may raise the window, not do it at all or indicate that a window requested to be raised in some other way, e.g. by flashing its icon if it is minimized.
Remarks:
This function only works for wxTopLevelWindow-derived classes.
如果始終置頂,可以在wx.Frame init里面加入屬性,如
def __init__(self,parent=None,id=-1,
pos=wx.DefaultPosition,
title='Hello',
style=wx.DEFAULT_FRAME_STYLE^(wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX) | wx.STAY_ON_TOP):
enjoy ^_^
總結(jié)
以上是生活随笔為你收集整理的linux 窗口z order,wxPython窗口z-order设置的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 《前庭凉夜》第三句是什么
- 下一篇: 看角色,问电影名称