emilbarton has asked for the wisdom of the Perl Monks concerning the following question:

Hello, I find impossible to change the background color of my tab as soon as I use the Podtext parameter as in :
my $Man_top_tw = $Tabs{'man'}->Scrolled ( 'PodText' , -background=>$COLOR{input_bgcolor} # Can't get these colors. , -foreground =>$COLOR{input_fgcolor} ,-file=> $Int_man ,-scrollbars => "se", ,-wrap => 'word' )->form( -top=>[$Man_frame,8], -left=>['%1',0], -right=>['%99',0], -bottom=>['%98',0] );
The tab then shows the same colors as the main window. This doesn't happen when I replace 'PodText' by 'TextUndo'. Any idea?

Replies are listed 'Best First'.
Re: Problem with Scrolled tab from Tk::Notebook widget using Podtext
by Khen1950fx (Canon) on Mar 22, 2012 at 16:40 UTC
    I was able to get the fg color, but I was unable to change or alter the bg color.
    #!/usr/bin/perl BEGIN { $ENV{'TKPODDEBUG'} = 1; } use strict; use warnings; use Tk; use Tk::Pod::Text; my $Man_frame = 8; my $file = '/usr/lib/perl5/5.8.8/CGI.pm'; my $mw = MainWindow->new; my $ptw = $mw->Scrolled ("PodText", -fg => 'black', -file => $file, -scrollbars => "se", -wrap => 'word', )->form( -top => [$Man_frame], -left => ['%1',0], -right => ['%99',0], -bottom => ['%98',0], ); MainLoop;
Re: Problem with Scrolled tab from Tk::Notebook widget using Podtext
by thundergnat (Deacon) on Mar 22, 2012 at 17:25 UTC

    I do not have Tk::Pod::Text installed and am not inclined to do so just to test this, but...

    Looking at the source of Tk::Pod, I notice:

    -background => ['PASSIVE'], # XXX see comment in Tk::More

    Hmmmm.

    In the source of Tk::More there is the line:

    -background => ['PASSIVE'],# XXX ignore -background, so optionAdd +works.... still decide

    Looks like you need to set the background color in the option database if you want to have it non-standard in a Tk::Pod::Text object. See perldoc Tk::option.

      Ok I'll try that, thanks
Re: Problem with Scrolled tab from Tk::Notebook widget using Podtext
by Anonymous Monk on Mar 22, 2012 at 16:54 UTC