CLIM mail archive


Re: multiple-color drawing...

    Date: Mon, 24 Jan 1994 10:20 EST

	    Date: Fri, 21 Jan 1994 22:10 EST
	    From: Colin Meldrum <>
	    At the moment the best you can do is to find the bounding rectangle of
	    text you are going to draw, draw a filled rectangle in the text
	    and then draw the text in the text foreground. This works fine if you
	    drawing all your text explicitly with calls to draw-text - but it
	    tricky if your text output is produced by format onto a clim-stream
	    a filling-output for example.
	SURROUNDING-OUTPUT-WITH-BORDER already does the right thing.

    But how can I use SURROUNDING-OUTPUT-WITH-BORDER to do the trick of drawing a 
    filled (and opaque) background rectangle *behind* the surrounded stuff?

    ;;; - Stefan Bernemann   (

I may be missing a critical part of this discussion, but I believe that
surrounding-output-with-border DOES arrange to draw the border `behind'
the surrounded stuff.  The source even anounces that it is kludged to
make that so.

Further, surrounding-output--- accepts drawing options so that you can
specify :filled t and whatever ink.  
For example, the following does something like what I'm thinking you
want [It's on a lispm where black text on white is default.  This
puts white text on a black rectangular background of appropriate size]. 

  (let ((s *standard-output*))
    (with-room-for-graphics (s)
      (surrounding-output-with-border (s :shape :rectangle :filled t)
	(with-drawing-options (s :ink +white+)
	  (format s "Hello!!!")))))



Main Index | Thread Index