Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: (ichimunki) Re: Tk::JPEG

by Jouke (Curate)
on Aug 16, 2001 at 12:20 UTC ( #105306=note: print w/replies, xml ) Need Help??


in reply to (ichimunki) Re: Tk::JPEG
in thread Tk::JPEG

And of course you can define all of this at once:
my $mw = MainWindow->new; my $photo = $button->Photo( -format => 'jpeg', -file => 'test.jpg' ); my $button = $mw->Button(-image => $photo)->pack(); MainLoop;


Jouke Visser, Perl 'Adept'
Using Perl to help the disabled: pVoice and pStory

Replies are listed 'Best First'.
(ichimunki) Re x 3: Tk::JPEG
by ichimunki (Priest) on Aug 16, 2001 at 16:40 UTC
    I think it's a little strange to call a method on $button before you have declared $button with my $button. Maybe you patched your parser with a lookahead feature, "hey, do I declare this later, if so I can use it now, right?" :)
      Brrr...you're right! I was way too quick with my answer! It should be this:
      my $mw = MainWindow->new; my $photo = $mw->Photo( "photo" -format => 'jpeg', -file => 'test.jpg' ); my $button = $mw->Button(-image => "photo")->pack(); MainLoop;


      Jouke Visser, Perl 'Adept'
      Using Perl to help the disabled: pVoice and pStory
        Now that's a trick worth knowing about! Keeping all image widgets as children of the MainWindow rather than in the widgets themselves makes managing them a lot easier (flipping images in Tk is a terrible memory leak unless done very carefully). It also allows for sharing a single photo widget among several other widgets if needed without having to reparent the original photo each time.
        Hi looking for something like this just to give me an idea I notice a missing comma it should be like this ?
        my $mw = MainWindow->new; my $photo = $mw->Photo( "photo", -format => 'jpeg', -file => 'test.jpg' ); my $button = $mw->Button(-image => "photo")->pack(); MainLoop;
        Or am I wrong?
        Thanks with the example you help me nail the problem
        THANKS!!!!!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://105306]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2019-08-21 11:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?