[xinf] DOM Events?
Nicolas Cannasse
ncannasse at motion-twin.com
Fri Jun 23 12:01:17 CEST 2006
>>Any comment from this last version ?
>
>
> I like the last version a lot, it is almost perfect and good enough,
> but and i'm thinking that
>
> public function handleEvent( target : Component, data : Rect ) {
> //
> }
> In Application, it is listening the Button's event, but the handleEvent must be
> handleEvent(targert:Component, data:Rect)
> can't be
> handleEvent(target:Button, data:Rect)
> I'm thinking a way to achieve this, but no idea yet, however, the last
> version is really good and make user can handle event conveniently.
That would need the following :
class AbstractComponent<T> {
public var onRefresh(default,null) : EventSite<T,Rect>;
}
class AbstractButton<T> extends AbstractComponent<T> {
public var onClick(default,null) : EventSite<T,{ x : Int, y : Int }>;
}
signature Component = AbstractComponent<Component>
signature Button = AbstractButton<Button>
It's a bit tricky but it works :)
Nicolas
More information about the xinf
mailing list