in reply to Re: creating multiple widgets at runtime
in thread creating multiple widgets at runtime

thank you GrandFather i am able to get multiple widgets now but i need to have different control for each widget say by clicking each widget i need to open different files.how can i do that
  • Comment on Re^2: creating multiple widgets at runtime

Replies are listed 'Best First'.
Re^3: creating multiple widgets at runtime
by GrandFather (Saint) on Jul 25, 2005 at 04:07 UTC

    This works for me:

    use strict; use warnings; use Tk; my @array = ("File1.txt", "File2.txt", "File3.txt"); my $main = MainWindow->new (); while (@array) { my $name=pop @array; $main->Button ( -text => "Open $name", -command => sub{`notepad $name`} )->pack(); } MainLoop;

    Perl is Huffman encoded by design.