[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: create image application
- To: firstname.lastname@example.org
- Subject: Re: create image application
- From: "Mark A. Tapia" <email@example.com>
- Date: Wed, 4 May 1994 14:09:35 -0400
- Cc: firstname.lastname@example.org
On Wed May 4, Enrique Paniagua writes:
We have evaluated the form: (save-application "pathname" :resources (form))
with a Resedit Resource File. At the compilation process the evaluation was t.
However when we restarted the stand alone appl. the listener evaluated a
error of :"don't a macptr".
We have a group of images and icons on a ResEdit Resource file,
we want to know how can we compile these resources evaluating the form
(funcall (form) "file saved").
I gather that you want to save resources with the application that you can
use when the application is launched. There is a relevant example in the
Binhex folder inside the Examples folder that comes with the MCL distribution.
The code fragment below copies resources from MCL and
ccl:examples;binhex;binhex resources.rsrc into the current
"work" space in preparation for a save-application. You'll need
to copy your resources using a similar technique. If you don't do
this then after saving your application, all of the pointers to the
resources will be "dead" macptrs.
If you don't use this method, then you'll have to keep the resources
in an other file and open the resource file(s) to access them. By
using the other method, you can avoid this step.
; The resource file contains icon ("ICN#", "icl8", etc.) resources for the
; application (id #128) and for the documents that it creates (id #129)
; and appropriate "FREF" and "BNDL" resources.
; MCL contains a resource of type "CCL2" and icon and "FREF" resources for
; a larger set of document types (ids in the range 128-132).
(with-open-resource-file (f "ccl:examples;binhex;binhex resources.rsrc")
(do* ((id 128 (1+ id)))
((> id 132))
(dolist (type '("FREF" "ics#" "ICN#" "icl4" "icl8" "ics4" "ics8"))
(push (list (if (<= id 129) (load-and-detach type id)) type id)
; We don't want a "CCL2" resource ...
(push (list nil "CCL2" 0) resources)
; We -do- want a resource of type binhex-file-creator ...
(push (list (#_NewHandle 0) binhex-file-creator 0 "MCL Binhex Example")
; Grab "BNDL"(128) from our resource file, replacing MCL's
(push (list (load-and-detach "BNDL" 128) "BNDL" 128) resources))
(save-application path :init-file nil :toplevel-function #'binhex-startup
:creator binhex-file-creator :resources resources
; in case the save is cancelled