SCWebView with Dashboard Widgets

Having trouble using an XCmd or XFcn? Post your questions here.

SCWebView with Dashboard Widgets

Postby sctell » Mon May 18, 2009 10:18 am

Hi,

I have just been playing with the SCWebView external and succeeded in getting a dashboard widget to run within the externals window.

This gives users another area in which SC can be used.

It is necessary to run the .html file contained within the package folder in the example I tried it was Calculator.html

I tried the AddressBook widget and that did function correctly so, it seems, a little trial and error is required.

If anyone gets any useful widgets to run then please post the details.
sctell
 
Posts: 1128
Joined: Sun Jul 06, 2008 10:41 am

Re: SCWebView with Dashboard Widgets

Postby Dave_Higgins » Mon May 18, 2009 10:39 pm

Yep. Yep. Pretty cool...

One thing I noticed is that the prefs for Weather didn't hold over. I set it for my location, quit the view, started a new view, then loaded Weather again and it started over from the defaults. Guess when I have time I'll dig through their code and see if I can tell what they're doing to hold settings and reload on new sessions. Hopefully it'll be easy to adjust for.
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon

Re: SCWebView with Dashboard Widgets

Postby Dave_Higgins » Mon May 18, 2009 11:20 pm

Yeah. I can see in the JavaScript that we'll have to find another way to save prefs, if needed. They rely on things like

  • if(window.widget)
  • widget.setPreferenceForKey("Goodbye, World!","worldString");
  • var worldString = widget.preferenceForKey("worldString");
which will return false for window.widget. Same thing happens in Safari if you load the HTML. Too bad they didn't use SQLite for them, since WebKit can now access local SQLite dbs. At least Safari 4 will... Not sure if Safari 3 already can or not. So when you can tie SCWebView to the WebKit that's powering Safari 4 then we could use that.

Speaking of which... I know the regular docs at developer.apple.com won't tell you how, but I wonder if it would be easy enough to tie into Safari 4 Beta's WebKit with the external. There's already some nice additions (that have shown up in the nightly builds for a while now) that would be fun to mess with.
My two favorite teams are Detroit and whoever's playing Chicago.
User avatar
Dave_Higgins
 
Posts: 454
Joined: Mon Jul 07, 2008 9:50 am
Location: Dark Side Of The Moon


Return to Using Externals

Who is online

Users browsing this forum: No registered users and 1 guest

cron