[comp.sys.mac.programmer] How can I display alerts in a ROM patch and more...

kishon-amir@CS.Yale.EDU (amir kishon) (12/18/89)

I am writing a ROM patch and everything works just fine until I want
my patch to do more than just add two numbers together i.e. display
alerts and windows, write to a resource file. And so my question is: What
do I need to do in order to be able to display alerts and windows,
write a resource, while in the ROM patch? (it seems to me that the
problem is due to the fact that the patch is a detached code
block that has no GrafPort and its resource file was already closed
after completing its INIT (which installed the patch.)


Thanks,

-amir kishon

===============================================================================
Amir Kishon                                 ARPA:   kishon@cs.yale.edu
Yale University, Computer Science Dept.             kishon@yale.arpa
P.O.Box 2158 Yale Station                   BITNET: kishon@yalecs.bitnet
New Haven, CT. 06520-2158                   UUCP:   ...!yale!kishon
(203) 432-1227                              
===============================================================================

slosser@fugitive.berkeley.edu (Eric Slosser) (12/20/89)

First, be sure that you HAVE to display an alert, and that the
program will be in a state (i.e. the managers init'ed) that
supports them.

To get to your resources, save the name and vRefNum of your resource
file.  Use the fact that a0 points to your code (at boottime),
and that your code is a resource in your resource file. 
RecoverHandle(), then HomeResFile(), then GetFInfo().

To get to screenbits when you don't have QD globals, use
GetWMgrPort().  To use QD patterns (grey,white,etc), make your own.

Eric Slosser, Gradual Student