wxpython: how do i write this without the id parameter?
jmbc at nospam.fr
Tue Jun 13 00:29:07 CEST 2006
John Salerno a écrit :
> I was reading in the wxPython wiki that most of the time you don't have
> to include the id parameter at all, and you can just use keyword
> arguments for other parameters. But I'm having trouble converting this
> code into that method (i.e., without the id parameter). I keep getting
> errors that involve wrong parameters, or that they are out of order,
> etc. So I'm hoping someone can show me how to re-write the constructors
> for InputForm and wx.Frame, as well as the __init__ method, so that they
> will just deal with parent and title.
May I suggest you to use wx.ID_ANY each time you need an id.
It's a very clean way to give it even if you don't really care.
For instance :
More information about the Python-list