wxpython窗口置顶和禁用父窗口例子
简介wxpython窗口置顶和禁用父窗口例子
wxpython窗口置顶和禁用父窗口例子
#coding=utf-8
import wx
import time
class TwoFrame(wx.Frame):
def __init__(self,parent):
self.parent = parent
wx.Frame.__init__(self, parent, -1,style=wx.MINIMIZE_BOX|wx.MAXIMIZE_BOX|wx.CLOSE_BOX|wx.RESIZE_BORDER|wx.SYSTEM_MENU|wx.CAPTION|wx.FRAME_FLOAT_ON_PARENT)
self.Show()
parent.Enable(False)
self.Bind(wx.EVT_CLOSE,self.OnCloseFame)
def OnCloseFame(self,event):
self.parent.Enable(True)
self.Destroy()
class MyFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self,None,-1,style=wx.DEFAULT_FRAME_STYLE)
panel = wx.Panel(self,-1)
wx.Button(panel,-1,'aaaaa')
print 'aaaaa'
panel.Bind(wx.EVT_LEFT_DOWN, self.OnMouse)
self.Show()
TwoFrame(self)
def OnMouse(self,event):
print 1
if __name__ == '__main__':
app = wx.App()
frame = MyFrame()
app.MainLoop()