Index: stream-output.lisp
===================================================================
RCS file: /project/mcclim/cvsroot/mcclim/stream-output.lisp,v
retrieving revision 1.57
diff -u -r1.57 stream-output.lisp
--- stream-output.lisp	12 Oct 2005 14:22:27 -0000	1.57
+++ stream-output.lisp	16 Feb 2006 14:04:41 -0000
@@ -331,7 +331,8 @@
 	 (new-baseline (text-style-ascent text-style medium))
 	 (new-height   (text-style-height text-style medium))
 	 (margin       (stream-text-margin stream))
-	 (end          (or end (length string))))
+	 (end          (or end (length string)))
+         (view-height  (bounding-rectangle-height stream)))
     (flet ((find-split (delta)  ;; FIXME: This can be done smarter.
 	     (loop for i from (1+ start) upto end
 	       as sub-width = (stream-string-width stream string
@@ -339,7 +340,7 @@
 						   :text-style text-style)
 	       while (<= sub-width delta)
 	       finally (return (1- i)))))
-  
+      
       (with-slots (baseline height vspace) stream
 	(multiple-value-bind (cx cy) (stream-cursor-position stream)
 	  (when (> new-baseline baseline)
@@ -350,6 +351,17 @@
 	    (setq baseline new-baseline))
 	  (if (> new-height height)
 	      (setq height new-height))
+          
+          ;; HACK?: Make sure the pane is large enough to accomodate the text.
+          (when (> (+ cy height) view-height)
+            (ecase (stream-end-of-page-action stream)
+              ((:scroll :allow)
+               (change-space-requirements stream
+                                          :width  (bounding-rectangle-width stream)
+                                          :height (+ cy height)))
+              (:wrap
+               (setq cy 0))))
+          
 	  (let ((width (stream-string-width stream string
 					    :start start :end end
 					    :text-style text-style))
