Move MainLoop; outside the while loop:
while(@array) { $file=pop @array; $top->Button(-text => "Click Me",-command => sub{ system "start c:/W +INNT/system32/notepad.exe $file" })->pack(); $x=$x+10; } MainLoop;
Note that c:/WINNT/system32/notepad.exe is not very portable. Use either Notepad $file or just $file (if $file has a .txt extension).
In reply to Re: creating multiple widgets at runtime
by GrandFather
in thread creating multiple widgets at runtime
by arunmep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |