wxpython: how do i write this without the id parameter?

John Salerno johnjsal at NOSPAMgmail.com
Tue Jun 13 09:50:01 EDT 2006


Scott David Daniels wrote:


> class InputForm(wx.Frame):
>     def __init__(self, parent=None, id=-1, title=__file__):
>         # or, if you prefer: ..., id=wx.ID_ANY, ...
>         wx.Frame.__init__(self, parent=parent, id=id,
>                                 title='%s v%s' % (title, __version__))

> class MyApp(wx.App):
>     def OnInit(self):
>         frame = InputForm(title='Data Entry Form')
>         self.SetTopWindow(frame)
>         frame.Show()
>         return True

Thanks, but there was an example (which I can't find now) somewhere in 
the wxPython wiki that showed a call to wx.Frame without the id 
parameter at all, like wx.Frame(parent, title). How is that possible?

Is the issue with my code just that I'm passing the parameters around 
and so I can't be as concise as that?



More information about the Python-list mailing list