[mcclim-devel] scrollbars and :command-loop
Christophe Rhodes
csr21 at cam.ac.uk
Thu May 11 15:09:06 UTC 2006
Hi,
I have an application pane with :display-time :command-loop, inside a
(scrolling ...) form. For the most part, in this application, it is
likely that the contents of this pane after a redisplay are similar to
those before: so, I would like to be able to preserve the viewport
position across redisplays.
I've come up with the following method on redisplay-frame-pane:
(defmethod redisplay-frame-pane :around ((frame gsharp) (pane gsharp-pane)
&key force-p)
(declare (ignore force-p))
(let ((transformation (sheet-transformation pane)))
(multiple-value-bind (x y) (window-viewport-position pane)
(multiple-value-bind (x1 y1) (untransform-position transformation x y)
(call-next-method)
(setf (window-viewport-position pane) (values x1 y1))))))
which meets the spec, I suppose -- I don't know how well-defined it
is, but it does what I wanted it to in McCLIM. However, it leads to
visual artifacts: the call-next-method here eventually calls
(window-clear), which resets the space-requirements and the
transformation of the sheet, which means the scrollbars change size;
then the whole of the redraw takes place, and only then does the
viewport's position get reset.
My question then is twofold. Firstly, is this a sensible thing to be
doing at all, or is there some other mechanism for achieving what I
want here? (Incremental redisplay might be it, but that has some
other problems in this application). Secondly, is there a way of
eliminating these glitches?
Cheers,
Christophe
More information about the mcclim-devel
mailing list