Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Tk ItemStyle problem on linux

by greenFox (Vicar)
on Jun 14, 2003 at 06:39 UTC ( [id://265865]=perlquestion: print w/replies, xml ) Need Help??

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

Hi, the code below runs fine on my active state 5.8 installation at work but barfs with the error:
    "at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Tk/ItemStyle.pm line 21."
under RH9.0, Perl 5.8.0 (fresh install from source) and Tk804.024. Interestingly if I only specify the background colour style it works fine. Any-one have any clues? Thanks.
#!/usr/bin/perl -w use strict; use Tk; use Tk::HList; use Tk::ItemStyle; use Tk::Label; my $mw = MainWindow->new(); my $label = $mw->Label(-width=>15); my $hlist = $mw->HList( -itemtype => 'text', -separator => '/', -selectmode => 'single', -browsecmd => sub { my $file = shift; $label->configure(-text=>$file); } ); my %priorities = ( 1 => { text => 'Highest', colour => 'red' }, 2 => { text => 'High', colour => 'orange' }, 3 => { text => 'Medium', colour => 'darkgreen' }, 4 => { text => 'Low', colour => 'blue' }, ); for my $int (1..4){ $priorities{$int}->{style} = $hlist->ItemStyle('text', -foreground => $priorities{$int}->{colour}, -background => 'white', -selectbackground => '#0A246A', -selectforeground => 'white', ); } foreach ( qw(/ /home /home/ioi /home/foo /usr /usr/lib) ) { $hlist->add($_, -text=>$_, -style=>$priorities{1}->{style}); } $hlist->pack; $label->pack; MainLoop;

Most of the code above is from the Tk::HList manapge, I used it to work up the test case :)

--
Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Replies are listed 'Best First'.
Re: Tk ItemStyle problem on linux
by greenFox (Vicar) on Jun 23, 2003 at 08:34 UTC

    Following myself up here... the behaviour I am seeing appears to be related to a known problem as reported on the ptk mailing list here and acknowledged here by Nick Ing-Simmons.

    I will submit a further bug report and update this node when I have more information

    Update: I have a patchset to test- http://www.cpan.org/modules/by-authors/id/L/LU/LUSOL/Tk804.024.patches-0.1.tar.gz gratefull thanks to Slaven Rezic, will further update when I have had a chance to test the patchset.

    Update: Applied the patchset all is now working as expected. Thanks again to Slaven and also to Steve Lidie and any-one else who put work into the patchset.

    --
    Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

Re: Tk ItemStyle problem on linux
by converter (Priest) on Jun 14, 2003 at 19:58 UTC

    "at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Tk/ItemStyle.pm line 21." tells us where the exception occurred, but doesn't tell us what the exception was. If you include the rest of the exception we may be able to help you figure out what's going wrong.

      Yep but that's all I get:
      $ ./hlist.pl at /usr/local/lib/perl5/site_perl/5.8.0/i686-linux/Tk/ItemStyle.pm li +ne 21. $
      Did you try running it?

      --
      Do not seek to follow in the footsteps of the wise. Seek what they sought. -Basho

        Yes. I tested it on perl 5.8.0 on two gentoo systems and a Debian (testing/unstable) system, all running perl 5.8.0. It seems to work fine, no errors.

        Is your original perl install from RPMs still functional? Have you tested with that build?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://265865]
Approved by benn
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-04-18 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found