On Friday December 23, 2005 04:17, Alex Russell wrote:
> So just to be extra clear about this: this module explicitly requires
> you to call signal(...) in order to have the event dispatched?
>
No, the built-in DOM events will be called as a signal. When you do something
like:
connect($('someID'), 'onclick', myClickHandler)
connect($('someID'), 'onclick', myOtherClickHandler)
it will call your click handlers with the event generated when the DOM element
is clicked.
If you want to create your own objects that have their own events (see Qt for
a millions examples), then your objects will have to call signal(this,
'signal') when they want to trigger a signal. But the DOM objects are
connected in a way that the events will trigger a call to signal()
automatically.
This way, both the DOM objects and the user-created objects have the same
interface for event handling.