Dali Clock 2.25

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.

Tags: , , , ,

13 Responses:

  1. zojas says:

    I still think it was totally cool when the digits all went backwards in xdaliclock for y2k :)

    • jwz says:

      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.

      • zojas says:

        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 :)

        • fu3dotorg says:

          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.

  2. mblagusz says:

    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.

    • jwz says:

      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?

      • mblagusz says:

        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.

        • jwz says:

          Mail me your working .js file?

        • jwz says:

          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.

  3. twiin says:

    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.

    • jwz says:

      Check the back of your machine, I think you have the switch set to "evil". Or perhaps "insane".

    • superbacana says:

      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.

  4. fu3dotorg says:

    Someone made an iPod version, too.