Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!purdue!decwrl!shelby!portia!jain From: jain@portia.Stanford.EDU (Deepak Jain) Newsgroups: comp.lang.lisp Subject: Problems with MACL Summary: start-picture behaves erratically! Keywords: QuickDraw Pictures, Error Message-ID: <7099@portia.Stanford.EDU> Date: 29 Nov 89 23:06:29 GMT Sender: Deepak Jain Reply-To: jain@portia.Stanford.EDU (Deepak Jain) Distribution: usa Organization: Stanford University Lines: 52 A sequence of QuickDraw commands in the Allegro CL for the Macintosh can be recorded in terms of a picture. The object functions `start-picture' and `get-picture' can be used for this purpose. I use these functions to save a picture so that I can play back the sequence of commands later whenever my window is brought to the front, or the screen needs to be refreshed otherwise. The code looks like the following. (defobject *my-windows* *window*) ; Object function to shadow the *window* class functions. (defobfun (window-draw-contents *my-windows*) (when (ask (self) (ownp 'saved-pict)) (ask (self) (draw-picture (ask (self) saved-pict)))) (usual-window-draw-contents)) ; *plan-window* inherits from *my-windows* (defun draw-floor-plan (*plan-window*) ... (ask *plan-window* (start-picture)) ... (draw something in the window using QuickDraw primitives) ... ; Get the picture and save it in a slot of *plan-window* (ask *plan-window* (have 'saved-pict (ask *plan-window* (get-picture)))) (ask *plan-window* (window-draw-contents)) ...) This code runs fine about half the time. At other times I get an error message like the following: Error: Picture for window: # is not started While executing: GET-PICTURE and nothing is drawn in the window. I am pretty sure that `start-picture' is indeed executed every time before `get-picture', as I have traced the functions. In view of this the above error really seems strange. What I find even more surprising is that I get the error only at some times and not always. If the same code starts a picture in one instance, it should always start the picture. What am I doing wrong? Can any enlightened soul help? I am using Allegro Common Lisp for the Macintosh, Version 1.2.2. Deepak Jain jain@portia.stanford.edu