Life With Font/DA Mover--Desk Accessories

Technote PT 19April 1985

Revised by: March 1988
Written by: Ginger Jenigan April 1985

This technical note describes how to make sure that your desk accessory will work after being moved by Font/Desk Accessory Mover.

If you want your desk accessory to work properly after being moved by the Font/DA Mover, there are some eccentricities that you need to be aware of. When the Font/DA Mover moves a desk accessory, it renumbers to avoid conflicts in ID numbers. It will also renumber all of your desk accessory's owned resources. See the Resource Manager chapter of Inside Macintosh for more information on owned resources.

Since these owned resources are renumbered, your code will need to calculate the resource ID of any owned resource it uses. For example, if your desk accessory has an owned `DLOG' resource, and calls GetNewDialog with the ID you assigned to it originally, the Resource Manager will not find it. The solution is that every time your desk accessory references an owned resource, it must figure out (at execution time) the ID of the resource according to the current driver resource ID.

When the Font/DA Mover renumbers, it does its best to keep resources pointing to each other properly. This means that it tries to renumber resource IDs embedded in other resources as well as the resources themselves. For example, the reference to a `DITL' within a `DLOG' or `ALRT' resource gets changed automatically. Font/DA Mover knows about the standard embedded resource IDs in most of the standard resources, but if you define your own, the Font/DA Mover won't be able to renumber them for you. The embedded resource IDs which the Font/DA Mover knows about are listed below.

Note that certain resources can never be owned, because their resource IDs are restricted to a certain range. One such example is a WDEF. Since the ID of a WDEF is specified along with a four bit variation code, the range of WDEF IDs that can be used is 0-16363. Since none of this falls within the owned resource ID range, WDEFs cannot be owned. For the same reason, MDEFs, CDEFs, and MBDFs can't be owned either.

As a rule of thumb, before you ship a desk accessory, move it to a disk with another desk accessory of the same ID. This will cause the Font/DA Mover to renumber your desk accessory. If the moved copy doesn't work, then there is probably something wrong with the way you are handling your owned resources.

Embedded resources known by Font/DA Mover

These are all true for Font/DA Mover 3.3 and newer:

* references to `DITL' resources in `DLOG'/`ALRT' resources

* references to `ICON', `PICT', `CTRL' in `DITL' resources

* references to `MENU' resources inside the resources themselves (menuID field)

* references to `MENU' resources in `MBAR' resources

Anything not on this list has to be fixed by the desk accessory.

By the way...

Before Font/DA Mover, desk accessories could have an ID in the range 12 to 31. Now, and in the future, desk accessories can only have IDs in the range 12 to 26, because Font/DA Mover will only assign numbers in this range. Numbers 27 thru 31 are reserved.

Further Reference:

Previous Technote | Contents | Next Technote