Logo Search packages:      
Sourcecode: xulrunner-1.9 version File versions  Download package

virtual nsresult nsIScriptContext::BindCompiledEventHandler ( nsISupports aTarget,
void *  aScope,
nsIAtom *  aName,
void *  aHandler 
) [pure virtual]

Bind an already-compiled event handler function to a name in the given scope object. The same restrictions on aName (lowercase ASCII, not too long) applies here as for CompileEventHandler. Scripting languages with static scoping must re-bind the scope chain for aHandler to begin (after the activation scope for aHandler itself, typically) with aTarget's scope.

Logically, this 'bind' operation is more of a 'copy' - it simply stashes/associates the event handler function with the event target, so it can be fetched later with GetBoundEventHandler().

aTarget an object telling the scope in which to bind the compiled event handler function. The context will presumably associate this nsISupports with a native script object.
aName an nsIAtom pointer naming the function; it must be lowercase and ASCII, and should not be longer than 63 chars. This bound on length is enforced only by assertions, so caveat caller!
aHandler the function object to name, created by an earlier call to CompileEventHandler
NS_OK if the function was successfully bound to the name
XXXmarkh - fold this in with SetProperty? Exactly the same concept!

Referenced by nsScriptEventHandlerOwnerTearoff::CompileEventHandler().

Generated by  Doxygen 1.6.0   Back to index