[fxruby-users] Styled text on arrays
lyle at lylejohnson.name
Mon Dec 1 11:16:04 EST 2008
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
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
@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|
text_widget.appendStyledText(finding + "\n", style1)
text_widget.appendStyledText(finding + "\n", style2)
Hope this helps,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the fxruby-users