Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing Arrays Between Widget and Plugin




On May 12, 2005, at 11:15 AM, Tom Bunch wrote:
Yes, it works fine. Um, I don't have a lot of time today (ADA submission
deadline tomorrow!) to look at this. Here are a few things I've noticed:
understood. and the time already taken is appreciated. And I apologize for not
being more specific about the way the zip file was set up (more to follow).


This xCode project, well, it doesn't build a widget. Which brings me to
my top Dashboard request for Apple: an xCode project template? It _does_
build a .widgetplugin.
understood, and I agree as well. I hoped the template would be part of
Tiger GM...but it wasn't.

You included a copy of JibbaJabba.wdgt wherein you've modified the value
of the Plugin key in the Info.plist, but you haven't updated the .html
to reference your own class. You probably also need to copy the
.widgetplugin into the .wdgt.
That part of the code is unmodified from the example I received...in fact,
I went ahead and put SimplePlugin.zip up as an 'original' reference. If you
leave the html as is, it calls the plugin code "correctly"(???).


I left the plugin out of the widget to make the zip file smaller. I should
have mentioned that part, I guess. Sorry for the wasted time.


I messed around with it that much and it will create an instance of your class,
but the javascript still doesn't recognize calls to it. And that's all the time I have...

Good luck! Sorry.
I appreciate you looking that far. Thanks.
-mark


On May 11, 2005, at 5:43 PM, Mark Rakes wrote:

Tom (and everybody else!),

Have you actually been able to make this work? I've tried it a few
different ways/times, and always get a crash.

I've modified the "JibbaJabba" (SimplePlugin) example I got from dts to show
how I think it should work...can you (or someone) take a look and tell me
what mistake I'm making?


It's in a zip called ModSimplePlugin.zip at http:// homepage.mac.com/mrakes/

Thanks in advance to any takers,
-mark


On May 10, 2005, at 10:25 PM, Tom Bunch wrote:


Yes. I suppose your NSArray is the result of a objC call? Supposing you've figured out how to call it already from javascript (see these methods)

+ (NSString *)webScriptNameForSelector:(SEL)aSel;
+ (BOOL)isSelectorExcludedFromWebScript:(SEL)aSel;

you can do something like this:

var things = MyWidgetPlugin.someThings();
if (things) {
var thingCount = things.length;
for (var thingIndex = 0; thingIndex < thingCount; ++ thingIndex) {
var aThing = things[ thingIndex];
}


Does that help?  Your plugin class just has an instance method like:

- (NSArray *)someThings;

-Tom



On May 10, 2005, at 1:19 PM, Stefan Hanshans wrote:


Is it possible to obtain an array (NSArray) from a widget plugin in JavaScript?

TIA

Stefan



_______________________________________________ Do not post admin requests to the list. They will be ignored. Dashboard-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/dashboard-dev/email@hidden

This email sent to email@hidden
References: 
 >Passing Arrays Between Widget and Plugin (From: Stefan Hanshans <email@hidden>)
 >Re: Passing Arrays Between Widget and Plugin (From: Tom Bunch <email@hidden>)
 >Re: Passing Arrays Between Widget and Plugin (From: Mark Rakes <email@hidden>)
 >Re: Passing Arrays Between Widget and Plugin (From: Tom Bunch <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.