CLIM mail archive

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

Replacing presentations (repost)



   From: Robert Pfeiffer <rdp@netcom.com>
   Date: Tue, 5 Jul 1994 09:15:13 -0700 (PDT)
   X-Mailer: ELM [version 2.4 PL23]
   Mime-Version: 1.0
   Content-Type: text/plain; charset=US-ASCII
   Content-Transfer-Encoding: 7bit
   Content-Length: 1344      

   Having been unsuccessful in my previous approach to "rolling my own"
   incremental redisplay, I've revised my plan and found another way to fail.

   Goal:
   Cause some presentations in a window to change color under program control.

   Approach #1 (previous attempt):
   a) SETF the PRESENTATION-TYPE of each presentation
   b) call REPLAY-OUTPUT-RECORD on each

   Problem #1:
   No change appears on the screen.

As I said before, this can't work because you are not generating any
new output.  REPLAY just replays old output, and setting the
presentation type doesn't generate output.

   Approach #2 (current attempt):
   a) get the BOUNDING-RECTANGLE-MIN-X, BOUNDING-RECTANGLE-MIN-Y, and
      OUTPUT-RECORD-PARENT of each presentation
   b) remove the orginal presentation using ERASE-OUTPUT-RECORD
   c) create a new presentation using PRESENT inside of
      WITH-OUTPUT-RECORDING-OPTIONS (STREAM :DRAW NIL :RECORD T)
   d) add the new presentation (output record) to the parent of the old one
      (which happens to be a STANDARD-CELL-OUTPUT-RECORD in this case)
      using ADD-OUTPUT-RECORD
   e) fix the coordinates of the new presentation using OUTPUT-RECORD-SET-POSITION
   f) call REPLAY on the new presentation

   Problem #2:
   Something in the output recording protocol becomes seriously broken. One clear
   aspect of this is that presentations disappear and reappear in new positions
   when the window is scrolled.

You are probably not obeying the overly complicated output record
coordinate protocols.  This is no surprise because (1) they are not
properly documented anywhere, and (2) they're way to complicated to
figure out if you don't have source code.  (In fact, even if you do
have source code, you'll still have problems figuring it out.)

   Surely there must be a simple way to achieve my very modest goal.
   Would someone please put me out of my misery and tell me what it is? :-)

Unless there is a compelling reason to do otherwise, I still think you
are best of jus tusing UPDATING-OUTPUT at a fairly fine level of
granularity.  There are some people who could probably get approach #2
working, but I know that this person probably won't be able to scrape
up the time to help you, unless you happen to be using LispWorks.  (I
wish it were otherwise, but I'm really just swamped.)

References:

Main Index | Thread Index