[Webkit-unassigned] [Bug 45192] Provide a way to trigger a <select multiple> onchange event on changes

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Sep 7 16:13:31 PDT 2010


https://bugs.webkit.org/show_bug.cgi?id=45192





--- Comment #23 from Joseph Pecoraro <joepeck at webkit.org>  2010-09-07 16:13:31 PST ---
(In reply to comment #22)
> Joe, here’s an example:
> 
> We could add a function that allows you to call any Objective-C method with a set of arguments of a given type. On the Objective-C controller. In fact, I thought we had this a while back, but I guess not.
> 
>     objCController.callMethod(select, "_activateItemAtIndex:", 1);
> 
> We could probably find a way to make this work for at least simple cases.

For simple cases this should be easy. But creating a generic version to support
multiple arguments, of various types (primitives and pointers) seemed to
trip up my implementations using performSelector and then NSInvocation.
I'd be interested to see a solution. My attempt used a WebScriptObject array
to pass in the arguments, so it looked something like:

  objCController.performSelector(obj, selector, [arg1, arg2]);

I walked the array and pulled out the (Obj-C) values using webScriptObjectAtIndex.
Passing these by address into NSInvocation gave me unexpected values.
My Obj-C knowledge is still pretty basic. If someone is interested in writing
something like this, the following links may be useful:

http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocSelectors.html
http://blog.jayway.com/2010/03/30/performing-any-selector-on-the-main-thread/
http://cocoawithlove.com/2008/03/construct-nsinvocation-for-any-message.html
http://stackoverflow.com/questions/313400/nsinvocation-for-dummies

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list