I have made a small program called 'Py-mailer' which allows you to login with your Gmail credentials and send text-only messages to anyone. I uploaded it on SourceForge( http://www.tinyurl.com/m4ans4).
The next step I had to take was to make a GUI for it. So, I started with wxPython:
import wx window=wx.App() class pymailer(wx.Frame): def __init__(self): wx.Frame.__init__(self,None,-1,"Pymailer",size=(500,500)) panel=wx.Panel(self,-1) menu=wx.MenuBar() items=wx.Menu() items.Append(201,"Quit") self.Bind(wx.EVT_LEFT_DOWN,self.Quit,id=201) menu.Append(items,"File") self.SetMenuBar(menu) wx.StaticText(panel,-1,"Please enter your Gmail login ID: ",pos=(10,10)) wx.StaticText(panel,-1,"Please enter your Gmail login password:\n(will not be stored)",pos=(10,40)) username=wx.TextCtrl(panel,101,"Login ID",pos=(220,10)) password=wx.TextCtrl(panel,102,"Password",pos=(220,40)) self.Centre() self.Show() def Quit(self,event): self.Close() pymailer() window.MainLoop()
But, on clicking 'Quit' in the 'File' menu, nothing happens! I think it is because in line 29, I have not passed the ID of the event, so how do I pass the ID? Or, is because of some thing else?