[fxruby-users] Printing text in bold

Lyle Johnson lyle at lylejohnson.name
Tue Nov 11 09:52:34 EST 2008

On Nov 10, 2008, at 4:10 PM, Stuart Clarke wrote:

> I have a FX GUI up and running on my system which displays text in a  
> text frame. It becomes quite difficult for me to pick things out in  
> this text within the GUI, therefore is it possible to print some of  
> the text in say bold or a different colour? The data I am printing  
> out is extracted from an array. Therefore do I have to do something  
> when the data is pushed into the array?

As Don noted, for most widgets (like FXLabel or FXTextField) you're  
stuck to just one font, in one style. If you're using the FXText  
widget, however, you can apply different styles to the text to get  
bolded text, or different colors. See the "styledtext.rb" example  
program that comes with FXRuby. There's also information about this in  
Chapter 7 of the FXRuby book.

Hope this helps,


"FXRuby: Create Lean and Mean GUIs with Ruby"
Now available from the Pragmatic Bookshelf!

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

More information about the fxruby-users mailing list