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

start-picture/get-picture question



I was creating a class to implement windows that will redraw themselves.

Here's the idea:
(Assume the window has a slot called "contents" that holds a picture.
Also assume that the view-draw-contents method for this class clears
the window and draws the picture in "contents" in the window)

Here is the function I defined to add graphic items to the window
(more or less):

(defmacro append-to-auto-redraw-window (win &rest items)
  `(with-focused-view ,win
     (start-picture ,win)
     (if (contents ,win) (draw-picture ,win (contents ,win)))
     ,@items
     (if (contents ,win) (kill-picture (contents ,win)))
     (setf (contents ,win) (get-picture ,win))))

Questions:

1) Isn't it true that unless I add a without-interrupts macro around the
   with-focused-view macro, I'll unintentially capture any
   activation/deactivation or redraw events in the picture while "items"
are
   being drawn?

2) However, if I do add the without-interrupts macro, isn't it possible
that
   interrupts could be disabled for too long.

3) Is there a better way to do this?

4) Are calls to start-picture, get-picture, kill-picture, and draw-picture
   particularly expensive?

--Thanks.