CLIM mail archive

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

Redisplay of a changing (and growing) list




I'm using:
(Genera 8.1.1, Clim 27.5)

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

	(defun test (stream)
	  (let* ((list (list 1 2 3 4 5))
		 (record
		  (updating-output (stream)
		    (do* ((elements list (cdr elements))
			  (count 0 (1+ count))
			  (element (first elements)(first elements)))
			 ((null elements))
			(updating-output (stream :unique-id count
						 :cache-value element)
			  (format stream "Element ~D" element)
			  (terpri stream))))))
		(sleep 3)
		(setq list (append list (list 6)))
		(redisplay record stream)
		(setq list (append list (list 7)))
		(sleep 3)
		(redisplay record stream)))


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:

	(define-application-frame test ()
		((pane-list :initform (list 1 2 3 4 5)
			    :accessor pane-list)
		 (pane-rec  :accessor pane-rec))
		...
		(:panes ((display-pane  :application
					:display-after-commands T
					:display-function 'draw-display
					:scroll-bars :vertical
					:end-of-page-action :scroll)
			...))
		...
	)

	;; initialize the output record for our pane
	(defmethod run-frame-top-level :before ((frame test))
	  (with-slots (pane-list) frame
	    (let ((stream (get-frame-pane frame 'display-pane)))
		(setf (pane-rec frame)
		      (updating-output (stream)
			(do* ((elements (pane-list frame)(cdr elements))
			      (count 0 (1+ count))
			      (element (first elements)(first elements)))
			     ((null elements))
			  (updating-output (stream :unique-id count
						   :cache-value element)
				(format stream "Element ~D" element)
				(terpri stream))))))))


	;; the redisplay method for the pane
	(defmethod draw-display ((frame test) stream)
	  (redisplay (pane-rec frame) stream))

	;; define a command to add items to the list
	(define-test-command (com-test :menu "test")
		()
	   (with-slots (pane-list) *application-frame*
		(setf pane-list (append pane-list (list (accept 'integer))))))


I've tried several different variations of this all pretty much with the
same effect.  I did get one version to work (unacceptably), but that 
redisplayed each integer every time (Kind of defeats the purpose of redisplay).
In that version, I created the output record in the draw-display method
which correctly redisplays each element.

			Thanks for any help, Bill

waarbau@tycho.ncsc.mil


Follow-Ups:

Main Index | Thread Index