November 6, 2006

Mac OS X Widgets

You will find other articles relevant to this document in these sections:
Cameron Manderson @ 7:11 pm

I was having a quick explore into Dashboard Widgets today, and was suprised that the interfaces were created in HTML and CSS stylising, with PNG images.

Through JavaScript you can invoke various actions on the operating systems including system calls. This virtually allows you to communicate with any style of scripts installed on the computer, such as your PHP/Mac/C scripts, or communicate with XML provided by a REST webservice (say FLICKR for example). Your application could really take advantage of the AJAX style applications, affecting the DOM presentation to the user (DHTML), invoking JavaScript and performing asynchronous calls reading XML and the like.

From what I can gather it operates the same as a Safari browser, and it reveals access to the OS through a API object called “widget” that becomes available to your HTML page. Example: widget.system(”/bin/echo ‘my clipboard contents’ | /usr/bin/pbcopy”, null);
The structure of a Widget is a folder (with the extension of .wdgt) and importantly contains the basic files:

my_widget.wdgt
- Info.plist - XML/Properties containing basic properties of your widget, such as version, security requirements, placement of close buttons etc
- Icon.png - Represents the Widget
- Default.png - Represents the operating Widget
- my_widget.html - The HTML operating Widget - needs to be specified in your Info.plist
Widgets introduce dozens of potential applications, infact just as many as you can imagine with any web application.

For more information and a tutorial, checkout:

Apple Dashboard Tutorial 

Share and Enjoy:These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • digg
  • Furl
  • Reddit
  • YahooMyWeb

1 Comment »

  1. For more ideas for Widgets check out the Apple Dashboard downloads site: http://www.apple.com/downloads/dashboard/top50/

    Comment by Cameron Manderson — November 6, 2006 @ 7:12 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment