[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resource



        Reply to:   RE>resource


Not sure I understand your problem, and what you mean by "loading."  Here's a
straightforward way of setting a default directory:

    (set-mac-default-directory (nth n (directory "*:myDirectory:" 
                                                                    
:directories t :files nil)))

Opening a resource file in that directory:

    (with-pstrs ((res_file ":myFile"))
      (#_UseResFile (#_OpenResFile res_file)))

And accessing resources in that file given their resource IDs:

    (#_GetResource "snd " id)
    (#_GetResource "PICT" id)


I usually attach my resources to the image itself.  You can do it using the
save-application command (the easy way) or copy them over by hand in ResEdit.  



--------------------------------------
Date: 8/16/1994 1:29 PM
To: Steve Casner
From: howell@cats.ucsc.edu



I am looking for the best way to load a resource from an
MCL-built application.  I need to create a pathname which will
load this resource during startup when the resource is at the
same level as the application but all other names are
unknown (and MCL is probably not on the machine being used).

Any advice would be greatly appreciated!

howell@cats.ucsc.edu

------------------ RFC822 Header Follows ------------------
Received: by qmgate.arc.nasa.gov with SMTP;16 Aug 1994 13:28:52 U
Received: from brazil.cambridge.apple.com (brazil.cambridge.apple.com
[198.112.73.3]) by eos.arc.nasa.gov (8.6.4/8.6.4) with SMTP id NAA01848 for
<casner@eos.arc.nasa.gov>; Tue, 16 Aug 1994 13:26:11 -0700
Received: from ministry.cambridge.apple.com by brazil.cambridge.apple.com with
SMTP (5.64/25-eef)
	id AA02857; Tue, 16 Aug 94 16:24:02 -0400
	for casner@eos.arc.nasa.gov
Received: by cambridge.apple.com (5.64/25-eef)
	id AA21068; Tue, 16 Aug 94 16:22:22 -0400
Received: from brazil.cambridge.apple.com by cambridge.apple.com with SMTP
(5.64/25-eef)
	id AA21063; Tue, 16 Aug 94 16:22:20 -0400
Received: from cats-po-1.UCSC.EDU by brazil.cambridge.apple.com with SMTP
(5.64/25-eef)
	id AA02834; Tue, 16 Aug 94 16:22:02 -0400
	for info-mcl@cambridge.apple.com
Received: from rufus.UCSC.EDU by cats.ucsc.edu with SMTP
	id NAA21844; Tue, 16 Aug 1994 13:22:14 -0700
From: howell@cats.ucsc.edu
Received: by rufus.UCSC.EDU (8.6.9/4.7) id NAA00613; Tue, 16 Aug 1994 13:22:14
-0700
Date: Tue, 16 Aug 1994 13:22:14 -0700
Message-Id: <199408162022.NAA00613@rufus.UCSC.EDU>
To: info-mcl@cambridge.apple.com
Subject: resource