[squeakland] [etoys-dev] How can I color one character of text?

Bert Freudenberg bert at freudenbergs.de
Thu Mar 14 20:25:45 EDT 2013


On 2013-03-15, at 01:05, Steve Thomas <sthomas1 at gosargon.com> wrote:

> I am working on a word recognition/typing program in Etoys for Haiti. (and anyone else who needs it).
> 
> I need to be able to change the color of the character at cursor.
> 
> How can I do this?  (squeak code is fine)




setColorAtCursor: color 
	| m |
	m := self costume renderedMorph.
	m text
		addAttribute: (TextColor color: color)
		from: m cursor
		to: m cursor.
	m changed

- Bert -


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20130315/1eaaf36f/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: PastedGraphic-14.png
Type: image/png
Size: 38203 bytes
Desc: not available
URL: <http://lists.squeakland.org/pipermail/squeakland/attachments/20130315/1eaaf36f/attachment-0001.png>


More information about the squeakland mailing list