Recent Widgets


Register for DashboardWidgets

Recent Forums Posts

Partners


iCompositions

MacDesktops.net

RSS Showcase
RSS Comments
RSS Forums

This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies. Posted in: Widget Development

So close! My plugin just wont work though.

Author Message
Nexum



Joined: 27 Mar 2005
Posts: 2

Posted: Sat Dec 04, 2004 - 7:19 am    Post subject: Imported from The Dashboader Reply with quote

Hi,

I have the WWDC seed of Tiger,

I am attempting to build a widget which uses an Obj C plugin. After much searching through the 3 sources available to me (Dashboard tutorial, Dashboard Dev Ref, Dashboard presentation DVD from WWDC)

I finally have my widget being able to load the plugin (the last thing that got me was forgetting to make my plugin run as root).

I know the plugin is running because I have an NSLog line when it gets created, so that's good.

I then go and expose the methods I want to call from the widget javascript thus:

+ (NSString*) webScriptNameForSelectorSEL)aSelector {
NSString *name = nil;

else if (aSelector == @selector(basicString))
name = @"basicString";

return name;
}

So by reading this the widget will be able to access the ObjC basicString method by using MyPluginObj.basicString() in JavaScript (where MyPluginObj is obviously the name of the ObjC object that the widget has been told about).

However, I have trouble actually getting a result back from the plugin... the basicString method just returns an NSString* very simply. And here's how I call that method in JavaScript:

<form name="first_form">
<input type="text" name="first_text" value="Blank for now">
</form>

<FORM>
<INPUT TYPE="button" VALUE="Get string from plugin"
onClick="window.document.first_form.first_text.value= MyPluginObj.basicString();">
</FORM>

This however gives me the following error in the console:

(event handler):Value undefined (result of expression MyPluginObj.basicString) is not object.

So I'm very much confused at this point, my JS is much worse than my ObjC, so maybe the error is here.

Any help would be much much much appreciated I've been staring at these developer docs for some time now, and the over-complex Validator sample plugin app isn't much use to me here either.

Thanks for any assistance,

- Nex
View user's profile Send private message Widgets
Ryan
Guest





Posted: Sat Dec 04, 2004 - 7:19 am    Post subject: Imported from The Dashboader Reply with quote

I am getting the same exact error. Have you figured out what is going on? I think that it has something to do with the WebScriptObject implementation but anything that I try results in the same. The documentation makes it seem so simple...
Widgets
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.

 
Powered by phpBB © 2001, 2002 phpBB Group