Don't understand wxPython ids

Roger Binns rogerb at rogerbinns.com
Wed Apr 28 14:50:41 EDT 2004


Grant Edwards wrote:
> I understand, but compare the above code with this:
>
> >           menu.Append("&Delete", "Delete the file", action=self.OnFileDelete)
> >           ....
> >           toolbar.AddLabelTool("Delete", action=self.OnFileDelete)
>
> Which is easier to understand at a glance?

If it is all in one place in one function then it is no big deal.
In reality if you have editable toolbars, menus loaded from definitions
elsewhere and stuff scattered across several modules then using
ids makes that easier.

Roger






More information about the Python-list mailing list