CLIM mail archive

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

multiple-color background drawing




I had asked how to do this:

+-----------------------------------------------+
|						|
|	this area is red (pane-background)	|
|						|
|						|
|		+---------------+		|
|		| this area has	|		|
|		| black text on	|		|
|		| a blue back-	|		|
|		| ground.	|		|
|		+---------------+		|
|						|
|						|
+-----------------------------------------------+


the question was: how to casually accomplish the blue background, given
that the pane's medium-background is different from what I want to see
behind the text...

(surrounding-output-with-border	
	(stream :shape :rectangle :ink +blue+ :filled t)
  (princ "this area has black text on a blue background" stream))

that's all there is to it.

it does exhibit the characteristic that the blue background is
a rectangle, as opposed to being text drawn with blue background color,
which manifests the problem Colin and Scott mentioned, that text which
does not stretch from left-edge to right-edge will have blank areas
which are blue. this is because :shape :rectangle actually calls
draw-rectangle* internally.

the important extra fact to note here is that s-o-w-b has
&allow-other-keys, and those keys are things which are acceptable to
draw-rectangle*, which is why :ink and :filled work

my manual (Allegro clim-2-beta) doesn't show the &allow-other-keys,
which was part of the reason I didn't see where to start solving this.
and the rest of the explanation with it is kind of weak.  an example
would be primo.

anyway, that's the answer.

 -- clint

Follow-Ups:

Main Index | Thread Index