in reply to Quick question about Tk(?)
use Tk; use strict; use warnings; my $mw = MainWindow->new(); for my $id (0 .. 3) { $mw->Button( text => "Button$id", command => sub { pub($id) } )->pack(); } MainLoop; sub pub { my $task_id = shift; print "task id = $task_id\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Quick question about Tk(?)
by pg (Canon) on Sep 24, 2004 at 16:17 UTC |