Hi Mattia,

Thank you very much! This is good news.
I've seen that I can set the colors of the text, and the alignment, but I couldn't find how to set a certain font with some attributes (bold, italic, underline). Could you please give me a short example?

I've done:

my $style = Wx::TextAttr->new();
$style->Wx::TextAttr::SetTextColour(wxBLUE);
$style->Wx::TextAttr::SetBackgroundColour(wxGREEN);
$style->Wx::TextAttr::SetAlignment(wxTEXT_ALIGNMENT_CENTRE);

Also, do you have any idea if I can use superscripts and subscripts with the methods provided by the library?

Thank you.

Octavian

----- Original Message ----- From: "Mattia Barbon" <[EMAIL PROTECTED]>
To: "Octavian Rasnita" <[EMAIL PROTECTED]>
Cc: <[email protected]>
Sent: Friday, March 21, 2008 7:15 PM
Subject: Re: wxTextAttr


Octavian Rasnita wrote:

  Hi Octavian,

I want to create a readonly multiline rich text control that has the wxTE_PROCESS_ENTER style, so I've tried to use
Wx::TextCtrl with the wxTE_RICH2 style.

I need to make some format settings in the control, like the font, the color, background-color, boldness and other things like that and I thought I can use Wx::TextAttr, but unfortunately I've read that all the methods for setting options of this module are not available in WxPerl.

  I think this was true for older wxPerl versions (can't remember how
much old); I use Wx::TextAttr to change font color on a Wx::TextCtrl
created with wxTE_RICH2, so this should work.

Can I make Wx::RichTextCtrl to create readonly controls that can be used with the keyboard? Or can I assign different formats to a Wx::TextCtrl using Wx::TextAttr or other methods?

  I do not have much experience with Wx::RichTextCtrl (besides writing
some code for the wxPerl demo), but you should be able to do what you
need using wxTextCtrl.

HTH
Mattia


Reply via email to