CLIM mail archive

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

Redisplay of a changing (and growing) list



    Date: Mon, 6 Jan 1992 22:50+0200
    From: "Lawrence G. Mayka" <lgm@iexist.att.com>

	Date: Mon, 6 Jan 1992 13:31 CST
	From: "William (Bill" <waarbau@tycho.ncsc.mil>, "Arbaugh)"@BBN.COM

	Does anyone know how to use incremental redisplay with a list
	that not only will be changing (items exchanging places) but
	is also growing inside an application frame?  For example, this
	works in a CLIM window (modified example from documentation):
	    ...
	However when I modify it to "work" with an application frame, each
	new item appears but the old ones disappear!  Here's the jest of the code:

    Hmm.  Your symptom sounds a lot like one I'm looking into (also on
    Genera).  If I run the example below in a CLIM Listener, the initial
    output of NOW IS should change into NOW HI-THERE, but instead becomes
    simply HI-THERE.

    (defun show-column (&optional (lst '(now is)) (stream *standard-output*))
      (let ((record
	      (clim:updating-output (stream)
		(clim:with-output-as-presentation (:stream stream
						   :object lst)
		  (clim:formatting-item-list (stream)
		    (dolist (elem lst)
		      (clim:formatting-cell (stream)
			(princ elem stream))))))))
	(sleep 3)
	(setf lst (copy-list lst))
	(setf (second lst) 'hi-there)
	(clim:redisplay record stream))
      (values))


	    Lawrence G. Mayka
	    AT&T Bell Laboratories
	    lgm@iexist.att.com

    Standard disclaimer.

I will try to reply to William (Bill's mail separately, however here's the answer to
the problematic code of Lawrence:

You simply forgot to provide an updating-output with a cache value.
The outermost clim:updating-output (stream) is only there to give you
one output record to which you can send the clim:redisplay message.
But every piece of output that should be separately redisplayed (because
of the changes that might happened to the data structure that is visualized)
must be surrounded by an explicit updating-output.

The code that follows corrects this: (changes are in upper case)

(defun show-column (&optional (lst '(now is)) (stream *standard-output*))
  (let ((record
	  (clim:updating-output (stream)
	    (clim:with-output-as-presentation (:stream stream
					       :object lst)
	      (clim:formatting-item-list (stream)
		(dolist (elem lst)
		  (UPDATING-OUTPUT (STREAM :CACHE-VALUE ELEM :CACHE-TEST #'EQUAL)
		    (clim:formatting-cell (stream)
		      (princ elem stream)))))))))
    (sleep 3)
    (setf lst (copy-list lst))
    (setf (second lst) 'hi-there)
    (clim:redisplay record stream))
  (values))

Unfortunately, the documentation about Incremental Redisplay is pretty incomplete.

Markus Fischer
Consulting Services
Symbolics Systemhaus GmbH
Mergenthaler Allee 77-81
6236 Eschborn
West Germany
Tel (from the US): 011-6196-47220


Follow-Ups: References:

Main Index | Thread Index