Re: The event API debate
Charles Goodwin <[email protected]> Wed, 31 Dec 2003 22:25:36 +0000
| Newsgroups | gmane.comp.java.xwt.widgets |
|---|---|
| Organization | XWT Foundation |
| Message-ID | <[email protected]> |
Just to further elaborate (as opposed to reply to my own mail)...
The widget API implements an 'action' for clickable widgets. The basic
example is a button. So, if you want do something when a button is
used, it simple:
action += function( v ) { ... }
Now, using _1_ API, I'm not entirely sure how this is going to work.
Are we going to use Press1? Or Click1? Or Release1? And what about
when a button is activated using a keystroke (ie 'enter' or 'space')?
So to replace the above, we'll be mandating:
myaction = function( v ) { ... }
Release1 += myaction;
KeyRelease += myaction;
This is why we shouldn't be writing off a widget API. A widget API
simplifies things, it presents only what is needed to be known of the
widgets. We may find that trying to contort a widget API through the
core API is not going to result in an intuitive interface for users.
KISS. What is simpler? 2 APIs, where 1 is only used for areas the
other doesn't cover? Or 1 API that requires a bit more (for want of a
better term) know-how in order to use?
- Charlie
--
Charles Goodwin <[email protected]>
Member of the XWT Foundation
The future of the net - www.xwt.org