[mcclim-devel] scrollbars and :command-loop
Christophe Rhodes
csr21 at cam.ac.uk
Fri May 12 12:58:57 EDT 2006
[added gsharp-devel, since that's where this patch would end up...]
"Andy Hefner" <ahefner at gmail.com> writes:
> I struggled with this a while ago and concluded that incremental
> redisplay is probably the intended solution.
While Andy said this in this forum, he did provide a hint in
another... on IRC, he said
<hefner> Xof: have you considered solving your scrolling problem by
setting :display-time nil and calling your display function yourself
from the top-level loop and using (clear-output-record
(stream-output-history foo)) rather than window-clear?
And so I tried it, and the attached patch is the result. I don't know
if it's climily correct, and it might suffer a bit from suboptimality
when loading in new files, but apart from that it does what I think I
want it to.
-------------- next part --------------
Index: gui.lisp
===================================================================
RCS file: /project/gsharp/cvsroot/gsharp/gui.lisp,v
retrieving revision 1.59
diff -u -r1.59 gui.lisp
--- gui.lisp 2 Mar 2006 09:29:44 -0000 1.59
+++ gui.lisp 12 May 2006 16:44:03 -0000
@@ -167,7 +167,18 @@
(score-pane:with-score-pane pane
(draw-buffer pane buffer (current-cursor)
(left-margin buffer) 100)
- (gsharp-drawing::draw-the-cursor pane (current-cursor) (cursor-element (current-cursor)) (last-note (input-state *application-frame*))))))
+ (gsharp-drawing::draw-the-cursor pane (current-cursor) (cursor-element (current-cursor)) (last-note (input-state *application-frame*)))
+ (multiple-value-bind (minx miny maxx maxy)
+ (bounding-rectangle* pane)
+ (declare (ignore minx maxx))
+ (change-space-requirements pane :height (- maxy miny))))))
+
+(defmethod window-clear ((pane score-pane:score-pane))
+ (let ((output-history (stream-output-history pane)))
+ (with-bounding-rectangle* (left top right bottom) output-history
+ (medium-clear-area (sheet-medium pane) left top right bottom))
+ (clear-output-record output-history))
+ (window-erase-viewport pane))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
-------------- next part --------------
So this patch does two things: one, after doing what drawing to the
score pane needs to be done, the :height space requirement is changed
to whatever it needs to be; two, window-clear calls are intercepted
and implemented following Andy's suggestion.
Comments?
Cheers,
Christophe
More information about the mcclim-devel
mailing list