CLIM mail archive


Re: multiple-color drawing...

  Date: Fri, 7 Jan 94  12:48:54 EST
  From: "Clint Hyde -- Master of the ad hoc odd hack." <HYDE@Exploder>

  #+ACL 4.2 pre-rel
  #+clim 2.0 pre-rel

  what I want to do is draw some text in my pane, where the
  background-color of the text is different from the background color of
  the pane. the text foreground is the pane foreground.

  equivalently, there are three colors, I wish to use two to draw, and the
  third is for undrawn areas.

  anyone know how to do this? I haven't found an obvious solution...

This would be easily implemented on the X based ports as the draw glyph
functions allow you to specify an opaque or transparent background.
Unfortunately in CLIM, there is no way to tell clim:draw-text whether you
want a transparent or opaque background - it always assumes transparent. 

A simple solution which I once considered was to add a :PAPER drawing
option (analagous to :INK) which would default to +nowhere+ However, this
isn't implemented and even if it where it wouldn't be portable. I think
that it would be a useful addition to the CLIM spec.

At the moment the best you can do is to find the bounding rectangle of the
text you are going to draw, draw a filled rectangle in the text background
and then draw the text in the text foreground. This works fine if you are
drawing all your text explicitly with calls to draw-text - but it becomes
tricky if your text output is produced by format onto a clim-stream within
a filling-output for example.

Colin Meldrum, Franz Inc.	1995 University Avenue, Suite 275         
colin@Franz.COM (internet)	Berkeley, CA 94704                       
uunet!franz!colin (uucp)	Phone: (510) 548-3600; FAX: (510) 548-8253

Follow-Ups: References:

Main Index | Thread Index