CLIM mail archive

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

Re: Changing the ink used for text locally and cleanly




> Where <s> is the output stream, do this:
> 
>   (with-drawing-options
>       (<s> :ink (if (contradictory? fact) *danger-ink*
>                     (if (derived? fact) *derived-ink*
>                         *user-ink*)))
>     (textify <some complicated expression> <s>))

Indeed, this works as suggested.  Thanks!

> I'm curious as to how you failed to find this in the CLIM documentation.
> Did you just miss it, or is there something seriously missing from the
> documentation?  I can perfectly well believe that the organization of
> the documentation simply hid this from you.

If you look at the CLIM user's guide, where would you look?  Well, in
the section on colors there is a nice description of inks and media.
Great so far.  But given that the other parameters of text are
governed by text styles, the assumption I made was that color, too,
should be a text style parameter.  The fact that draw-text takes an
explict ink argument reinforced this model.  There was nothing I could
spot in the section on text styles that suggested how I should deal
with color, nor in the section on formatted output.  I never ever
thought to look at the drawing environments stuff in this context, in
part because I knew that format wasn't about to handle explicit :INK
keywords like draw-text.  

In retrospect, it's easy to see that it is a more systematic design
choice to use the drawing properties for both.  But a cross-reference
to the drawing stuff in the description of text styles would have made
this clear.

	Ken

References:

Main Index | Thread Index