iWidgets is a tweak that displays HTML/CSS widgets on SpringBoard. Creating a widget can be simple if you understand the basics of HTML and CSS.
Components of an iWidget
There are three files required to make an iWidget: Widget.html, Widget.plist, and Options.plist. Even if you have never worked with plists, you can probably figure out how this works. The easiest way to learn is by looking at what other developers have created. Install some iWidgets and look at them (located in
/private/var/mobile/Library/iWidgets/) to see how they work.
This plist (Property List) is used to set the height and width of your widget.
This plist is used to configure the user settings that are shown when selecting the widget to be used.
Creating a Simple iWidget
First off, all iWidgets are stored in
/private/var/mobile/Library/iWidgets/ on the device. Each directory is the name of the widget that will be displayed in the iWidgets access menu.
Create a new directory and name it whatever you want. I'm just going to use the name "TestWidget".
Next we create our three files in the TestWidget directory. Now we can get to the fun stuff. Let's first start with our Widget.plist. Like previously stated, this file tells iWidgets the height and width of the widget. Below is an example.
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>size</key> <dict> <key>height</key> <integer>200</integer> <key>width</key> <integer>320</integer> </dict> </dict> </plist>
As you get a sense of what your widget will look like, you will probably need to change the values. You want to keep the widget size just big enough to fit the widget your are displaying. That way it doesn't take up extra space in the user's display.
Now we come to the HTML part. All widgets should follow the standard HTML page structure.
Next, you'll need to create a folder called Library, and create two files inside it: script.js and stylesheet.css
To be continued... If anyone has anything to add who have worked with iWidgets, please do so!