To do this you will not be able to make use of the standard multi-line text field. If you wanted all messages in the field to be of one color this would be fine, however, to have multiple colors in the field you will need to make use of the RichEdit control. Beware of dependancies on older systems J

 


From: perl-win32-gui-users-bounces@lists.sourceforge.net [mailto:perl-win32-gui-users-bounces@lists.sourceforge.net] On Behalf Of Maxmelbin Neson (RBIN/EMT1)
Sent: Wednesday, August 22, 2007 6:16 AM
To: perl-win32-gui-users@lists.sourceforge.net
Subject: [perl-win32-gui-users] How to print text in COLOR in Textfield

 

 

Hello All,

I have a multiline Textfield which acts as my output console.

$main = Win32::GUI::Window->new(-name => 'Main',
                                -text => 'Perl Win32 GUI',
                                -width => 550,
                                -height => 660,
                                -maximizebox => 0,
                                 );

$outputText  = $main->AddTextfield(
               -name =>"outputTextField",
               -width => 500,
               -height => 290,
               -left   => 20,
               -top    => 290,
               -readonly => 0,
               -multiline => 1,
               -vscroll =>1,
               -hsscroll => 1,
                );

 

Now I want to print the messages in this text filed in different colours ..
Like …

$outputText->Append("The list file $opt_list is invalid.\r\n");

How can I print in some color say Red …
Or should I use something else?

Thanks and Regards
Maxmelbin Neson
-----------------------------------------------------------------------------------------------------------------
Robert Bosch India Limited
Engineering Services - DS - Methods and Tools (RBIN/EMT1)
123 Industrial Layout  -  Hosur RoadBangalore 560 095  -  INDIA
Telephone: +91 80 6657-4532      Fax: +91 80 6657-1404
maxmelbin.neson@in.bosch.com
www.bosch.com