Re: The event API debate
Charles Goodwin <[email protected]> Thu, 01 Jan 2004 00:32:45 +0000
| Newsgroups | gmane.comp.java.xwt.widgets |
|---|---|
| Organization | XWT Foundation |
| Message-ID | <[email protected]> |
On Wed, 2003-12-31 at 22:41, Tupshin Harper wrote: > It seems obvious that any widget should be able to expose it's own > mini-api. Suppose, for example, that you have "SpinnyWidget" which has > two modes - spinning and not spinning. The widget has very complex > dependencies determing whether it spins or not (obAbsurdism: it spins > for 3 seconds every time a menu is selected and the time is between 4:30 > and 4:35). It should be possible to trigger events everytime that widget > stops or starts spinning without having to worry about the > implementation details. I don't see how the one API approach would > address this at all. You would have to re-implement the "is it > spinning?" logic every time you wanted to use the widget. > > Conceptually, maybe we shouldn't look at it as two separate APIs, but as > extending the core API. Excellent summary of how we should be viewing it. And to follow up, I'd like to point out that 'action' is an extension of the Press/Release and KeyPressed/KeyReleased API that sums up the execution of said events under appropriate circumstances. And that the visual state triggers 'active', 'hover', and 'normal' are event extensions to notify widgets of when they need to change visual state without having to monitor the core event API. I sound awfully defensive. This is not intended. I'm more trying to point out that this is a well thought out event model and I'm almost certain that it needs not rethinking, but adapting to the new API that accompanies the Nitrogen core. - Charlie -- Charles Goodwin <[email protected]> Member of the XWT Foundation The future of the net - www.xwt.org