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

clip-region interaction with princ

I need to clip text to a region (really a rect) in a window, but it seems that
the standard princ function applied to a window does not obey the clip region.
E.g., if you evaluate the following code, the paint-rect is properly clipped,
but the princ is not.

(defclass foowin (window) ())

(defparameter w1 (make-instance 'foowin))

(defmethod view-draw-contents :after ((w foowin))
  (with-region rgn
    (clip-region w rgn)
    (clip-rect w 100 100 150 150)
    (paint-rect w 90 90 140 210)
    (#_MoveTo 102 110)
    (princ "The quick brown fox did something?" w)
    (set-clip-region w rgn))

Am I misunderstanding something, or is this a bug?  In either case, is there
anything simple to do short of creating a static-text-dialog-item of the right
size and using that?  (I'd prefer not to have to do that, and I'd also prefer
not having to figure out how to truncate the string to the right length to fit
in its "cell".)

Thanks.  --Pete Szolovits