| Dali Clock 2.25 |
[Mon, 12-Nov-2007 8:51 PM] |
Dali Clock 2.25 out now. The only change this time around is that I converted it to a Dashboard widget. I did the build on MacOS 10.5.0, but I think I have things set up so that it will all still run on 10.4.0 or newer. However, early reports indicate that the Dashboard widget doesn't work on 10.4.10. Update: Fixed! Re-download it. Version number unchanged. Also I signed the code with a self-signed cert. I wonder if that did anything sane. It's surprising that signatures don't show up in Get Info in Finder. Dashcode is weird. I couldn't figure out whether I should check the .wdgt into CVS or the .wdgtproj or both. Also I couldn't figure out how to make the widget be resizable, or how to add color selectors to the preferences panel on the back. |
|
|
| Comments: |
![[User Picture]](http://p-userpic.livejournal.com/59312879/169914) | From: zojas Tue, 13-Nov-2007 5:11 AM (UTC)
y2k | (Link)
|
I still think it was totally cool when the digits all went backwards in xdaliclock for y2k :)
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Tue, 13-Nov-2007 5:14 AM (UTC)
Re: y2k | (Link)
|
It's even cooler than you think, because I had to plan that almost two years ahead of time in order to make sure it made it into all the Linux distros, and the code was hidden well enough that nobody noticed it in the diffs.
In short, I rule.
![[User Picture]](http://p-userpic.livejournal.com/59312879/169914) | From: zojas Tue, 13-Nov-2007 5:19 AM (UTC)
Re: y2k | (Link)
|
I agree! after it happened, I looked at the code, and was mystified when I couldn't figure out how it did it. it was pretty well hidden!
now we need an easter egg flag to turn that on at will :)
From: fu3dotorg Tue, 13-Nov-2007 2:56 PM (UTC)
| (Link)
|
Or a doomsday database of every cult's predicted apocalypse.
--isnear-whichend andromilk (~~3.5 billion year countdown) --isnear-whichend atheists (Sunday morning; "any day now.")
..and so on, but with better keywords.
The bug on 10.4 you mention is due to the widget's principal class not being set. You can set this either in the Properties for the widget plugin target, or directly inside the plugin's Info.plist (NSPrincipalClass = "DaliClockWidgetView"). Make sure to clean the project in Xcode before rebuilding, since it's lousy about catching plist modifications. I think what's going on is that if there's no principal class set, Dashboard just instantiates a random class from your plugin and sends it -initWithWebView. Which is kind of insane, if that's really what they're doing. But even after I fixed that, I'm still getting an error where a WebUndefined object (wrapper for a JS undefined value) is getting passed in to -[DaliClockWidgetView web_setDateStyle:]. From what I can tell, this is just the result of doing an initial load with no prefs present. So I'm not sure why it would work differently on Leopard. Incidently, a good source of debugging hints is Apple Technote TN2139. Some things may be now easier with Dashcode, though.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Tue, 13-Nov-2007 6:08 AM (UTC)
| (Link)
|
Thanks!
Is the latter fixed by changing e.g.,
window.DaliClock.setDateStyle(widget.preferenceForKey(createInstancePreferenceKey("dateStyle")));
to
window.DaliClock.setDateStyle(widget.preferenceForKey(createInstancePreferenceKey("dateStyle")) || 0);
in DaliClock.js?
From: mblagusz Tue, 13-Nov-2007 6:48 AM (UTC)
I got it working | (Link)
|
I used the || 0 trick for all three prefs, which fixed the exceptions I was getting. However, the JavaScript load() method gets called in Tiger before the window is set up, so document.width and document.height are 0. Moving the call to setFrame() into show() fixed it, and the widget seems to work fine now.
One quirk is that I can't drag the window by the transparent parts, but I'm not sure how to fix that, if it's even possible.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Tue, 13-Nov-2007 6:50 AM (UTC)
Re: I got it working | (Link)
|
Mail me your working .js file?
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Tue, 13-Nov-2007 6:51 AM (UTC)
Re: I got it working | (Link)
|
I think there's no way to make fully transparent windows be draggable. Which is why I wanted to add color wells, so you could select the foreground and background colors and alphas, but I'm not sure those exist in the dashboard world.
![[User Picture]](http://p-userpic.livejournal.com/70524252/169583) | From: twiin Tue, 13-Nov-2007 6:04 AM (UTC)
| (Link)
|
I would like you to know that upon loading my friends list, your post took over my monitor and turned it into a giant fullscreen quicktime-powered melting clock.
Not having seen your post until after I got back to my Desktop and reloaded by browser, it was a very confusing experience.
![[User Picture]](http://p-userpic.livejournal.com/5887295/515656) | From: jwz Tue, 13-Nov-2007 6:07 AM (UTC)
| (Link)
|
Check the back of your machine, I think you have the switch set to "evil". Or perhaps "insane".
When I load this page on Firefox on Windows, the machine practically grinds to a halt. I blame the QuickTime plug-in for Windows. I don't expect JWZ to have any sympathy.
When I load it on Firefox on the Mac, there isn't a problem.
From: fu3dotorg Fri, 23-Nov-2007 11:06 AM (UTC)
iPhone | (Link)
|
| |