37,719
社区成员
发帖
与我相关
我的任务
分享
def __init__(self):
wx.Frame.__init__(self, None, -1, "Produce Auto Test Paltform",pos=wx.DefaultPosition,
size = (900,600),
style=wx.DEFAULT_FRAME_STYLE |wx.SUNKEN_BORDER |wx.CLIP_CHILDREN )
import wx
class myframe(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Bitmap Button Example',
size=(200, 150))
self.Bind(wx.EVT_CLOSE,self.OnClose)
def OnClose(self, evt):
ret = wx.MessageBox('Do you really want to leave?', 'Confirm', wx.OK|wx.CANCEL)
if ret == wx.OK:
# do something here...
evt.Skip()
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = myframe()
frame.Show()
app.MainLoop()
import wx
class myframe(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Bitmap Button Example',
size=(200, 150))
self.Bind(wx.EVT_CLOSE,self.OnClose(self))
def OnClose(self, evt):
print "close"
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = myframe()
frame.Show()
app.MainLoop()