[fxruby-users] Styled text on arrays

Stuart Clarke stuart_clarke86 at yahoo.com
Tue Dec 2 11:56:33 EST 2008

Oh that is a shame, it would be useful if somone could figure that out. Thanks for your suggestion though I will give it a go. 
Many thanks

--- On Mon, 1/12/08, Lyle Johnson <lyle at lylejohnson.name> wrote:

From: Lyle Johnson <lyle at lylejohnson.name>
Subject: Re: [fxruby-users] Styled text on arrays
To: fxruby-users at rubyforge.org
Date: Monday, 1 December, 2008, 4:16 PM

On Dec 1, 2008, at 7:00 AM, Stuart Clarke wrote:

I was wondering can I use styled text to assign one occurance of @evtrievefindings.push as being in the colour red, eg.

if 100
@evtrievefindings.push "info"
if 200 
@evtrievefindings.push.changestyle "different info"

Does this make sense? Basically I want my program to write the contents of the array to the text frame as normal but when data meets one criteria I want the data written to the array to be a colour.

If what you're asking is whether you can embed some sort of markup in the text itself to change the text style (e.g. as you do with HTML), and the answer to that question is no.

What you might want to investigate is appending text to the FXText window incrementally (instead of setting the content in one fell swoop), e.g.

@evtrievefindings.each do |finding|

text_widget.appendText(finding + "\n")


And then once you've got that working, switch over to using styled text. You would still need to keep some sort of indicator in the @etrievefindings array (or a parallel array), but you could at least know which style to apply:

@etrievefindings.each do |finding|

if condition1

text_widget.appendStyledText(finding + "\n", style1)


text_widget.appendStyledText(finding + "\n", style2)



Hope this helps,

fxruby-users mailing list
fxruby-users at rubyforge.org

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081202/b0454eb6/attachment-0001.html>

More information about the fxruby-users mailing list