Create your own widgets

Apple claims that if you know how to create a website, you can create a widget. That happens to be true because there’s really not much else to it: widgets are written in html, javascript, ajax and in any other thing that you would use for a website.

There’s a very in-depth tutorial here –> http://developer.apple.com/documentation/AppleApplications/Conceptual/Dashboard_Tutorial/index.html but I’ll give you the basics to get you started:

You only need 4 files to create a widget:

1. Icon.png - You can generate this in any way you want. It must me more less as small as the other icons you see when you add widgets to dashboard.

2. Default.png - This is basically the background of your widget. Again, should be about the size of a regular widget, and you can generate it in any way you want.

3. MyWidget.html - This is what your widget actually does. You can use anything you’d use when writing a website.

4. Info.plist - This is the only relatively difficult thing to do. You can create it with Propertly List Editor and only 5 values are required:

CFBundleIdentifier - E.g. com.apple.widget.MyWidget

CFBundleName - Just the name of your widget

CFBundleDisplayName - Again the name of your widget, except that this is how it will actually appear everywhere

CFBundleVersion - Self explanatory

MainHTML - The name of your MyWidget.html file

That’s it, just put those 4 files in a folder and then rename the folder as MyWidget.wdgt. After it’s changed its extension, you can simply double-click it to install.

Technorati Tags: , ,

Similar Posts:

I Like This Tip!


One Response to “Create your own widgets”

  1. This is helpful. Apple has some in depth info as well. Have you seen anyone that has good documentation of AJAX calls or parsing data from the web?

Post a comment to "Create your own widgets"



MacTips Newsletter


Twitter MacTips

  • Stay up to date with the latest Mac tips, tricks and news by following us on twitter: MacintoshTips.

AppleGazette Headlines

Most Popular Tips (30 Days)

Most Commented (30 Days)

Good Tips

Recent Discussions

MacTips Poll

What level of tips would you like to see?

View Results

Loading ... Loading ...

Friends of MacTips

Subscribe to MacTips

Site Links