<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>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. </DIV>
<DIV>&nbsp;</DIV>
<DIV>Many thanks<BR><BR>--- On <B>Mon, 1/12/08, Lyle Johnson <I>&lt;lyle@lylejohnson.name&gt;</I></B> wrote:<BR></DIV>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid">From: Lyle Johnson &lt;lyle@lylejohnson.name&gt;<BR>Subject: Re: [fxruby-users] Styled text on arrays<BR>To: fxruby-users@rubyforge.org<BR>Date: Monday, 1 December, 2008, 4:16 PM<BR><BR>
<DIV id=yiv1501784615><BR>
<DIV>
<DIV>On Dec 1, 2008, at 7:00 AM, Stuart Clarke wrote:</DIV><BR class=Apple-interchange-newline>
<BLOCKQUOTE type="cite">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD vAlign=top>I was wondering can I use styled text to assign one occurance of @evtrievefindings.push as being in the colour red, eg.<BR><BR>if 100<BR>@evtrievefindings.push "info"<BR>end<BR>if 200 <BR>@evtrievefindings.push.changestyle "different info"<BR>end<BR><BR>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.</TD></TR></TBODY></TABLE></BLOCKQUOTE><BR></DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV>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.</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>@evtrievefindings.each do |finding|<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>text_widget.appendText(finding + "\n")<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>end<BR></DIV>
<DIV><BR></DIV>
<DIV>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:</DIV>
<DIV><BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>@etrievefindings.each do |finding|<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>if condition1<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>text_widget.appendStyledText(finding + "\n", style1)<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>else<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>text_widget.appendStyledText(finding + "\n", style2)<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>end<BR></DIV>
<DIV><SPAN class=Apple-tab-span style="WHITE-SPACE: pre"></SPAN>end<BR></DIV>
<DIV><BR></DIV>
<DIV>Hope this helps,</DIV>
<DIV><BR></DIV>
<DIV>Lyle</DIV></DIV><PRE>_______________________________________________
fxruby-users mailing list
fxruby-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/fxruby-users</PRE></BLOCKQUOTE></td></tr></table><br>