Re: Scrollbar misbehaving w/ ROText ?

[email protected]
Newsgroups gmane.comp.lang.perl.tk
Message-ID <[email protected]>
Is it possible to use tagConfigure for COLORS in a listbox widget?


#!/usr/bin/perl -w
use strict;
use warnings;

use Tk;
use Tk::ROText;


my $top = MainWindow->new();
my $frame1 = $top->Frame();

my $listbox = $frame1->Scrolled("Listbox")->pack(-side=>'left', -
fill=>'y', -expand=>0);

my $text1 = $frame1->ROText()->pack(-fill => 'both', -expand=> 1, -side 
=> 'left');
my($output)=$text1->Scrolled('ROText')->pack(-fill=>'both',-expand=>1, -
padx => 5);
$output->Subwidget('yscrollbar')->configure(-cursor => 'arrow');

$output->tagConfigure('BLUE',-foreground => 'blue');
$output->tagConfigure('LTBLUE',-foreground => 'light blue');
$output->tagConfigure('RED',-foreground => 'red');
$output->tagConfigure('GREEN',-foreground => 'green');
$output->tagConfigure('LTRED',-foreground => 'orange');
$output->tagConfigure('LTGREY',-foreground => 'light grey');
$output->tagConfigure('YELLOW',-foreground => 'yellow');

#trying the following against the scrolled listbox gets me error:
#Can't locate auto/Tk/Listbox/tagConfigur.al in @INC (@INC contains:
#C:\Program Files\ActiveState Komodo 3.1\dbgp\perllib
#C:/Perl/lib C:/Perl/site/lib .) at C:/Perl/site/lib/Tk/Derived.pm line 
469
#$listbox->tagConfigure('RED',-foreground => 'red');

$frame1->pack(-side => 'top', -fill=>'both',-expand=>1);

$output->insert('end',"This is a test",'RED');
#$listbox->insert('end',"TEST",'RED');
$listbox->insert('end',"TEST");

MainLoop();
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server.  If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.