Hi all, 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? Thanks in advance! -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081110/cad65fc9/attachment.html>
On Mon, Nov 10, 2008 at 4:10 PM, Stuart Clarke <stuart_clarke86 at yahoo.com>wrote:> Hi all, > > 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? > > Thanks in advance! >Hi, Stuart - It appears to me that a font element is associated with a whole FXRuby object. I don''t believe it''s possible to change font in mid-stream. There is no reason, though, why you can''t build your display from a series of FXLabels (or FXTextFields with TEXTFIELD_READONLY) set to different weights of text or different sizes, one per line. It should be possible to (with appropriate :padding set and no LAYOUT_FILL) create a linear stream of text blocks, word by word, in the layout manager. The packer would stack them one after another, left to right and then down. Obviously more work than inserting <B>BOLD</B>, but do-able. For hardcopy printing, you can build a Postscript or RTF document and print it. HTH, let us know what you generate! -- :D -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081110/e157c4fc/attachment.html>
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, Lyle --- "FXRuby: Create Lean and Mean GUIs with Ruby" Now available from the Pragmatic Bookshelf! http://www.pragprog.com/titles/fxruby -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/fxruby-users/attachments/20081111/ef2c22aa/attachment.html>