You might find it more useful for other things such as putting the computer to sleep after your 37 minute download complets and you're already out the door.
Anyway, some links that came in handy while doing this for the first time:
Debugging Dashboard Widgets (especially if you have to use an Objective-C cocoa plugin)
The (X) to close the widget positions itself offset from the corner.
Implement buttons using the
Now compiled for OSX 10.6: http://sites.google.com/a/davidssons.com/martin/files/Sleeper.wdgt.zip
Source also available at http://github.com/emtrane/Sleeper