[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-rdf
Subject:    Re: example code for XBL objects listening for events
From:       Gavin Doughtie <gdoughtie () anim ! dreamworks ! com>
Date:       2003-12-16 0:04:28
[Download RAW message or body]

Thank you very much! I lost a couple of hours of snoozing last night to 
this one.

Neil wrote:
> Gavin Doughtie wrote:
> 
>> The "this.builder" in the XBL object is null when I set it to be the 
>> event handler directly
> 
> 
> "this" always refers to event.currentTarget (i.e. the object on which 
> the event listener was added), at least for a function-type event 
> listener. But you can also use an object-type event listener. To do that 
> you need an object with a handleEvent method. You can either create a 
> new JS object, or modify your XBL binding, in which case you also need 
> <implementation implements="nsIDOMEventListener">. (The reason that you 
> don't need that for a new JS object is that Mozilla will assume that 
> because you used it as an event listener that it is in fact an 
> nsIDOMEventListener).
> 

-- 
Gavin Doughtie
DreamWorks SKG
(818) 695-3821

_______________________________________________
Mozilla-rdf mailing list
Mozilla-rdf@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-rdf
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic