in reply to Re^2: Feedback for programming a UI in Perl
in thread Feedback for programming a UI in Perl
I don't know what you mean by trigger.
#!/usr/bin/perl # http://perlmonks.org/?node_id=1170638 use strict; use warnings; use Tk; use Tk::JPEG; use Image::Size; my $file = '../smalltux.gif'; my ($w, $h) = imgsize($file); my $mw = new MainWindow; my $one = $mw->Frame()->pack; my $labelone = $one->Label(-text => 'Panel One', -fg => 'red', )->pack(-side => 'left'); $one->Button(-text => 'On', -command => sub { $labelone->configure(-fg => 'green')}, )->pack(-side => 'left'); $one->Button(-text => 'Off', -command => sub { $labelone->configure(-fg => 'red')}, )->pack(-side => 'left'); my $c = $mw->Canvas(-width => $w, -height => $h )->pack(); my $im = $c->Photo(-file =>$file); $c->createImage(0, 0, -image => $im, -anchor => 'nw'); my $two = $mw->Frame()->pack; my $labeltwo = $two->Label(-text => 'Panel One', -fg => 'red', )->pack(-side => 'left'); $two->Button(-text => 'On', -command => sub { $labeltwo->configure(-fg => 'green')}, )->pack(-side => 'left'); $two->Button(-text => 'Off', -command => sub { $labeltwo->configure(-fg => 'red')}, )->pack(-side => 'left'); MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Feedback for programming a UI in Perl
by Anonymous Monk on Aug 29, 2016 at 03:51 UTC | |
by Discipulus (Canon) on Aug 29, 2016 at 09:34 UTC | |
|
Re^4: Feedback for programming a UI in Perl
by Anonymous Monk on Aug 30, 2016 at 01:24 UTC | |
by Anonymous Monk on Aug 30, 2016 at 20:21 UTC | |
by Anonymous Monk on Aug 31, 2016 at 00:11 UTC | |
by Anonymous Monk on Sep 01, 2016 at 15:25 UTC | |
by Anonymous Monk on Sep 01, 2016 at 19:17 UTC | |
|
Re^4: Feedback for programming a UI in Perl
by Anonymous Monk on Aug 29, 2016 at 03:42 UTC |