More good points. Is this reason enough to leave the event
binding function names alone?
I don't see much need to alter the binding function names drastically.
In some ways, I like the all-caps names, as they "stand out", and
hence highlight the places where event handlers are registered.
There's also the lib.evtmgr library, for a different form of event
handling.
With my current prototype we've got names like this:
>>> import wx
>>> wx.bind.left_dclick
Looking at this, I'm not keen on it.
If we have an opportunity to rename them, let's take advantage
of that and turn them into something everyone likes.
Agreed - to the extent that we don't *have* to rename unless people
really want it.
Lowercase is easy, so that's what I did. Moving them into their
own namespace eliminates the need for the EVT_ prefix, so that
was taken off as well.
It's certainly worth doing as an experiment, but having seen it (albeit
only in brief snippets) I don't like it.
We could easily leave the constant in the new wx module with the old
name ("wxEVT_LEFT_DCLICK"), rather than removing the "wx" prefix, to
eliminate that possible confusion. Thoughts? Opinions?
Keep it simple: wx.EVT_LEFT_DCLICK and wx.wxEVT_LEFT_DCLICK.
Reasons:
1. Easy to mentally translate to & from the C++ docs.
2. Less likely to be controversial because it's closer to the
status quo.
3. Easier to automatically translate code using the old names
to the new ones. (Especially if the translation is manual rather
than by program).
Paul.
···
From: Patrick K. O'Brien [mailto:pobrien@orbtech.com]