Author Topic: Tips & Tricks  (Read 8925 times)

srs

  • TodayPlus Veteran
  • *****
  • Posts: 542
Tips & Tricks
« on: November 08, 2003, 11:03:19 PM »
Creating Skins:

Here are a couple of tips to aid you in creating skins:
  •    Each region that displays information and will be individually updated should have a valid associated defregion.  The defregion is used in clearing the section of the Today Screen occupied by that region.  When the region is updated (and a full rerender is not used), only the area specified by the defregion is cleared and only the specified region is redrawn.  Without a valid defregion you will see overwritten text.

  •    At end of a full rerender (a full rerender is done on startup, and when -1 is used as one of the regions to update in the button commands), the final offset is calculated, and the height of the plugin in the Today Screen is set at this offset.  Use offset or offsetadd to ensure that the correct height is calculated.

  •    Avoid using a full rerender as much as possible.  Only updating specific regions is much faster and more efficient.  The only time a full rerender is really needed is when the height of the plugin needs to change.  At all other times it should be possible to not use a full rerender.
  •    defregions are only processed during a full rerender.

  •    “offset,offset_-1,offset_-1” should follow a defregion.  What this does is set the current offsets to what’s specified by the defregion.  While this is redundant for a full rerender, it is vital if the region is individually updated.  Without this, when this region is individually refreshed, its position will be wrong.

  •    maxheight is used to initially allocate the size of buffer used.  It should be greater than or equal to the maximum height the plugin will ever reach.  maxheight is not used for anything else.