CLIM mail archive

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

Re: Is there a way to manually "tweak" inferior presentations



To minimize response to my question about manual tweaking of inferior
presentations, how bout using the Big Scientific Graph timing example where
the datums are inferior presentations to the dataset. What would a command
to change the datum's appearance look like (i.e. the datums would display
themselves either as simple points (in the draw-datum method) or as little "pluses" based upon a slot, let's say called draw-flag being t or nil in:

(defclass simple-datum ()
	((u :initarg :u)
	 (v :initarg :v)
	 (size :initform 2)
	 (draw-flag :initform nil)
	))


and draw method now looks like:

(defmethod draw-datum ((self simple-datum) x y stream)
	(cond ((null (slot-value self 'draw-flag)) (draw-point* stream x y))
	      (t (draw-text* stream "+" x y :align-x :center
				:align-y :center))))

What would the following command look like?

(define-bsearch-example-command (com-change-datum-appearance :name t)
    ((datum 'simple-datum :gesture :select))
   (let ((stream (whatever-the-stream-is-that-the-datums-and-datasets-are-on)))
	(erase-output-record datum stream)
	(setf (slot-value datum 'draw-flag)
		(not (slot-value datum 'draw-flag)))
        ;code to incrementally update datum's dataset to the new presentation
	;as one of its inferiors and just display the new datum presentation
	))

 Where we do not replay the dataset that the datum is part of?

0,,


Main Index | Thread Index