All pastes #616470 Raw Edit

wx

public python v1 · immutable
·published 2007-07-12 17:32 UTC
rendered paste body
import wxclass Window(wx.Frame):    def __init__(self,parent,id,title):        wx.Frame.__init__(self,parent,id,title,wx.DefaultPosition,wx.Size(860,680))        menubar=wx.MenuBar()        file=wx.Menu()        help=wx.Menu()        file.Append(1,"&Add","Add a new contact")        file.Append(2,"&Delete","Delete an existent contact")        file.Append(3,"&Search","Search an existant contact")        file.AppendSeparator()        file.Append(5,"&Quit\tCtrl+Q","Quit the Phonebook")        help.Append(7,"&How to use","A little tutorial")        help.AppendSeparator()        help.Append(9,"&About Macroware","About Macroware")        menubar.Append(file,"&File")        menubar.Append(help,"&Help")        self.Bind(wx.EVT_MENU,self.Quit,id=5)        self.Bind(wx.EVT_MENU,self.Add,id=1)        self.Bind(wx.EVT_MENU,self.Search,id=3)        self.Bind(wx.EVT_MENU,self.Del,id=2)    def Quit(self,event):        self.Close()    def Add(self,event):        pass    def Search(self,event):        pass    def Del(self,event):        passclass Dialog(wx.Dialog):    def __init__(self,parent,id,title):        wx.Dialog.__init__(self,parent,id,title)class MyApp(wx.App):    def OnInit(self):        frame=Window(None,-1,"Macroware's Phonebook")        frame.Show(True)        return Trueapp=MyApp(0)app.MainLoop()