CLIM mail archive

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

Redisplay of a changing (and growing) list



    Date: Tue, 7 Jan 1992 05:12 CST
    From: Markus Fischer <mf@FELDBERG.SGER.Dialnet.Symbolics.COM>

    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))

The good news is that with your modification, the code works perfectly.

The bad news is that I don't understand your explanation.  Omission of
CLIM:UPDATING-OUTPUT, as I understand it, should not cause erasure of
one (and not the other!) line of output; on the contrary, omission of
CLIM:UPDATING-OUTPUT should force reprinting of all the lines of output.

Perhaps a better example of my problem is the following:

(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)
		    (clim:updating-output (stream :cache-value elem :cache-test #'equal)
		      (princ elem stream)))))))))
    (sleep 3)
    (setf lst (copy-list lst))
    (setf (second lst) 'hi-there)
    (clim:redisplay record stream))
  (values))

This example, which exhibits the same problem I reported earlier, is
identical to your correctly working version except that the order of
CLIM:FORMATTING-CELL and CLIM:UPDATING-OUTPUT is reversed.  Why does
that make a difference?  What are the ordering rules for CLIM
constructs?


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

Standard disclaimer.


Follow-Ups: References:

Main Index | Thread Index