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

While using perl-tk on hp-ux i used the -tile options with a Frame. I am now using Red Hat Linux 5.1 and when i run the tk gui i get "unknown option "-tile" ". Any ideas why this does not work on Red Hat? Here is the code:

my $image = $mw->Bitmap(-file => "bw.bm"); my $frame = $mw->Frame(-relief => "flat", -tile => $image)->pack(-fill + => "both", -side => "left", -expand => "1", -anchor => "w", -pady => "2");

Replies are listed 'Best First'.
Re: Frame -tile option
by zentara (Cardinal) on Nov 19, 2008 at 17:14 UTC
    There has been some recent discussion of the tile option in comp.lang.perl.tk. Basically, it is not reliable in Perl/Tk based on Tk 8.4 , it dosn't work for me here either. Tile is supposed to be in Tk8.5 and hopefully the next Perl/Tk release ( if there is one :-( ).

    In the meantime, you can hack around it

    #!/usr/bin/perl ######################################## ### How to fake a background tile ### ### using the place geometry manager ### ######################################## use warnings; use Tk; use strict; my $mw=tkinit; $mw->geometry('500x430'); #my $file = './zen16.gif'; my $file=Tk->findINC('demos/images/earthris.gif'); my $image = $mw->Photo(-file=>$file); my $w = $image->width; my $h = $image->height; for (my $i=0; $i<$mw->screenwidth; $i+=$w) { for (my $j=0; $j<$mw->screenheight; $j+=$h){ $mw->Label(-image=>$image)->place(-x=>$i, -y=>$j); } } $mw->Button(-text=>"Pack your")->pack; $mw->Button(-text=>"widgets")->pack; $mw->Button(-text=>"like normal !")->pack; MainLoop;

    I'm not really a human, but I play one on earth Remember How Lucky You Are
      thanks it worked
Re: Frame -tile option
by mr_mischief (Monsignor) on Nov 19, 2008 at 17:27 UTC
    Update: zentara beat me to the punch with a more informed and complete answer. BTW, it's frustrating how difficult it is to find a definitive list of package versions for RHEL or HP-UX through the web.

    My guess, and this is just a guess, is that if you're getting different behavior between Tk on HP-UX and RHEL that either the Tk is somehow different or the Perl module Tk.pm is somehow different.

    As a further guess, the Changes file for Tk doesn't seem to contain the words 'tile', 'frame', or 'frame' so I think the difference may be in the underlying Tk system on your RHEL installation. You may want to compare versions and see if that's the source of your trouble.