Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; use Tk; use Tk::JPEG; use LWP::Simple; use MIME::Base64; my $UPDATE_INTERVAL = 10; my $CAM_URL = "http://192.168.0.25"; my $CAM_TITLE = "Cam - North View"; my $mw = MainWindow->new; $mw->title($CAM_TITLE); my $buttonImage = $mw->Photo( -format => 'jpeg' ); my $TT = $mw->Button(-image => $buttonImage)->pack; $mw->after( $UPDATE_INTERVAL,[\&update_image]); MainLoop; sub update_image { my $data = encode_base64( get($CAM_URL) ); $buttonImage = $mw->Photo(-data => $data, -format => 'jpeg'); $TT->configure(-image => $buttonImage); $mw->after( $UPDATE_INTERVAL,[\&update_image]); };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: TK Photo Cam - Memory Leak
by johanvdb (Beadle) on Jul 15, 2002 at 22:29 UTC | |
by Anonymous Monk on Jul 15, 2002 at 22:37 UTC | |
|
Re: TK Photo Cam - Memory Leak
by Anonymous Monk on Jul 15, 2002 at 22:26 UTC | |
by ichimunki (Priest) on Jul 16, 2002 at 18:23 UTC |