Re: widgets plan proposal
David Crawshaw <[email protected]>
| Newsgroups | gmane.comp.java.xwt.general |
|---|---|
| Message-ID | <[email protected]> |
On Wednesday, April 2, 2003, at 02:52 AM, Charles Goodwin wrote:
> So the behaviour either has to assume the preapply of focus or be with
> the
> preapply of focus.
This is where using traps/variables over functions makes this trait a
powerful tool. Our core widgets without the proper preapply's (like
xwt.theme.radiobutton) can assume they preapply focus. They might have
traps like:
_keypress = function(k) { ... tricky stuff here ...}
_focused = function(k) { ... }
xwt.widget.radiobutton preapplies focusable, and suddenly all of this
inactive code starts working.
However, a widget developer can use xwt.theme.radiobutton directly.
They have access to all the functionality of these, but it only runs
when they tell it to.
<template>
<xwt.theme.radiobutton id="spec"/>
_keypress = function(k) { if (myspecialcase) $spec.keypress = k; }
</template>
This is what I perceive to be the power of trap/function based control,
and a reason to separate the preapply's. Removing one or two adjectives
can leave all the functionality, but take all the automatic behavior.
d
_______________________________________________
http://lists.xwt.org/listinfo/dev