[comp.sys.mac.programmer] Alerts and Dialog Boxes in Desk Accessories

maymudes@husc4.HARVARD.EDU (David M. Maymudes) (01/26/89)

IM gives the conventions for numbering resources that are owned by a desk
accessory, and warns that your desk accessory may be renumbered.  Resource 
ID's have to be recalculated from your DA's ID.  The FONT/DA Mover renumbers   
your DA's resources, but it doesn't change, for instance, the DITL ID stored in
a DLOG or ALRT resource.  Short of modifying the resources in place in the 
resource file before calling GetNewDialog() or Alert(), is there any way to 
get around this problem?

(I'm converting an application to a DA, and want to avoid, say, getting rid of
all GetNewDialog() and Alert() calls.)

Replies via mail or this group welcome.  Thanks.


						--David Maymudes

maymudes%husc4@harvard.ARPA	maymudes@husc4.harvard.edu
maymudes@husc4.UUCP		maymudes@HARVUNXU.BITNET
...{sesimo, harpo, ihnp4, linus, allegra, ut-sally}!harvard!husc4!maymudes
davidm@harvarda.BITNET


						--David Maymudes

maymudes%husc4@harvard.ARPA	maymudes@husc4.harvard.edu
maymudes@husc4.UUCP		maymudes@HARVUNXU.BITNET
..{sesimo, harpo, ihnp4, linus, allegra, ut-sally}!harvard!husc4!maymudes
davidm@harvarda.BITNET

bob@accuvax.nwu.edu (Bob Hablutzel) (01/26/89)

> IM gives the conventions for numbering resources that are owned by a desk
> accessory, and warns that your desk accessory may be renumbered.  Resource 
> ID's have to be recalculated from your DA's ID.  The FONT/DA Mover renumbers   
> your DA's resources, but it doesn't change, for instance, the DITL ID stored in
> a DLOG or ALRT resource.  Short of modifying the resources in place in the 
> resource file before calling GetNewDialog() or Alert(), is there any way to 
> get around this problem?

Read Tech Note 23. As of Font/DA Mover 3.3, DITL id numbers _for DITLs
imbedded in DLOGs or ALRTs_ will be renumbered properly. (That is, they
will be given the same number as the owner). Thus, at runtime, all you have to
do is recalculate the id numbers. 

> (I'm converting an application to a DA, and want to avoid, say, getting rid of
> all GetNewDialog() and Alert() calls.)

Gee, do you really need them? :-)

> 						--David Maymudes
> maymudes%husc4@harvard.ARPA	maymudes@husc4.harvard.edu
> maymudes@husc4.UUCP		maymudes@HARVUNXU.BITNET
> ...{sesimo, harpo, ihnp4, linus, allegra, ut-sally}!harvard!husc4!maymudes
> davidm@harvarda.BITNET

Bob Hablutzel	Wildwood Software	BOB@NUACC.ACNS.NWU.EDU

tim@hoptoad.uucp (Tim Maroney) (01/27/89)

In article <1086@husc6.harvard.edu> maymudes@husc4.HARVARD.EDU (David M.
Maymudes) writes:
>IM gives the conventions for numbering resources that are owned by a desk
>accessory, and warns that your desk accessory may be renumbered.  Resource 
>ID's have to be recalculated from your DA's ID.  The FONT/DA Mover renumbers   
>your DA's resources, but it doesn't change, for instance, the DITL ID stored in
>a DLOG or ALRT resource.

Yes it does.  See Tech Note #23.  It changes DITL id's in DLOGs and
ALRTs, ICON, PICT, and CNTL IDs in DITLs, and MDEF ids in MENUs.
Remember, you can't program the Mac without familiarity with *both* IM
and the Tech Notes.
-- 
Tim Maroney, Consultant, Eclectic Software, sun!hoptoad!tim
"Gangsters would kidnap my math teacher, Miss Albertine, and I'd track them
 down and kill them one by one until she was free, and then she'd break off
 her engagement with my sarcastic English teacher, Mr. Richardson, because
 she'd fallen hopelessly in love with her grim-faced and silent
 fourteen-year-old savior." -- Nite Owl, in WATCHMEN by Alan Moore