Don't understand wxPython ids

Robert Brewer fumanchu at amor.org
Thu Apr 29 02:58:03 EDT 2004


Greg Ewing wrote:
> Roger Binns wrote:
> > Here is how I use the same id in multiple locations.  I can have a
> > menu entry, a toolbar button, and a button inside some HTML all
> > invoke the same function.  The only coupling between them is
> > the id number.
> 
> Giving an identifier to a command so that it can be
> invoked in multiple ways is a good idea, but it would
> be much more Pythonic if a *name* could be used as the
> identifier rather than a number.
> 
> Use of a number here seems to be entirely the result
> of blindly carrying over a feature of the C++-oriented
> API into Python.

Dang. If only we had some kind of tool in Python that could 'map' names
to numbers, and perhaps another that could (what's a good word?) 'wrap'
one function in another. Oh, well. Back to Java, I guess. ;)


FuManChu




More information about the Python-list mailing list