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

Resource file



   From: clefort@unix1.sncc.lsu.edu (Clinton R Lefort)
   Date: 7 Jan 1995 08:22:40 -0500

   I have a resource file which I would like to load frm MCL, could
   someone give me an example, like (require-trap #_getresource or
   something..

For example, you can open a resource file and get a resource as follows:

? (mac-namestring (choose-file-dialog))
"HD3:sample cursor"
? (with-pstrs ((name *))
    (setq quux (#_OpenResFile name)))
;Compiler warnings :
;   Undeclared free variable QUUX, in an anonymous lambda form.
10530
? (setq foo (#_GetResource "CURS" 128))
#<A Mac Handle to resource 'CURS'(128) : Unlocked, Size 68 #x30CD978>
? (#_ResError)
0
?

...	(now you can use the CURS resource)

? (#_CloseResFile quux)
NIL
? (#_ResError)
0
? 

CloseResFile is not normally needed, since all open resource files are
closed when an application terminates. If you wish to retain the data
of one or more resources in the file, you can use DetachResource
before closing the file.

----- Thanks -----
UEDA Masaya
Information Technology Research Lab., SHARP Co.
2613-1 Ichinomoto, Tenri, Nara 632, JAPAN
TEL: +81-7436-5-2466	FAX: +81-7436-5-2163
ueda@shpcsl.sharp.co.jp