[comp.windows.x] Need multicolor text widget advice

termaat@emmetal.cs.wisc.edu (Pete TerMaat) (02/08/90)

I need a text widget for which color information is
per-character rather than per-widget, as I want to
highlight arbitrary chunks of text using different
colors.

- Has anyone done this?

- How much work would it be to write a widget which
  does this, or to modify the Athena text widget?

Please email your response.

Thanks in advance,
Pete TerMaat
termaat@cs.wisc.edu

kit@EXPO.LCS.MIT.EDU (Chris D. Peterson) (02/22/90)

> I need a text widget for which color information is
> per-character rather than per-widget, as I want to
> highlight arbitrary chunks of text using different
> colors.

> - Has anyone done this?

Not in any text widget that I have heard of.

> - How much work would it be to write a widget which
>   does this, or to modify the Athena text widget?

Once you decide how to encode this information into the text it should be a
pretty simple matter to render the text in different colors, by modifying the
AsciiSource in the Athena text widget.

I didn't feel that it was worth trying to come up with a text encoding with
color information, so one color is all you get.  Once you have the encoding
telling the text widget to do the right this should be trivial.


						Chris D. Peterson     
						MIT X Consortium 

Net:	 kit@expo.lcs.mit.edu
Phone:   (617) 253 - 9608	
Address: MIT - Room NE43-213

ben@hpcvlx.cv.hp.com (Benjamin Ellsworth) (02/23/90)

We did something like that in an output only fashion, and it wasn't too
hard.  Input could be much harder...

No, I can't send you source.

-----------------------------------------------------------------------
Benjamin Ellsworth      | ben@cv.hp.com                | INTERNET
Hewlett-Packard Company | {backbone}!hplabs!hp-pcd!ben | UUCP
1000 N.E. Circle        | (USA) (503) 750-4980         | FAX
Corvallis, OR 97330     | (USA) (503) 757-2000         | VOICE
-----------------------------------------------------------------------
                     All relevant disclaimers apply.
-----------------------------------------------------------------------