Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import wx
- class bucky(wx.Frame):
- def __init__(self,parent,id):
- wx.Frame.__init__(self,parent,id,"Frame aka window",size=(600,400))
- panel=wx.Panel(self)
- button=wx.Button(panel,label="Exit",pos=(50,10),size=(60,60))
- buttonw=wx.Button(panel,label="Write",pos=(140,10),size=(60,60))
- self.Bind(wx.EVT_BUTTON,self.writerow,buttonw)
- self.Bind(wx.EVT_BUTTON,self.closebutton,button)
- self.Bind(wx.EVT_CLOSE,self.closewindow)
- status=self.CreateStatusBar()
- menubar=wx.MenuBar()
- first=wx.Menu()
- second=wx.Menu()
- first.Append(wx.NewId(),"New Window","test")
- second.Append(wx.NewId(),"Close Window","test")
- menubar.Append(first,"File")
- menubar.Append(second,"Edit")
- self.SetMenuBar(menubar)
- def closebutton(self,event):
- self.Close(True)
- def closewindow(self,event):
- self.Destroy()
- def writerow(self,event):
- print "this is a test"
- if __name__=='__main__':
- app=wx.PySimpleApp()
- frame=bucky(parent=None,id=-1)
- frame.Show()
- app.MainLoop()
Add Comment
Please, Sign In to add comment