murugu has asked for the wisdom of the Perl Monks concerning the following question:
Hi great Monks,
This is my first program in PERL/TK.
I want user to select some text files from a list of text files in a folder.
I created that number of check buttons inorder to be selected by the user.
Pushing the checked contents into an array.
where the MainLoop must be placed. (i.e) where to use the array @a, whether before mainloop or after it.
My part of code is here:
my @a=(); @dir=qw(a.txt b.txt c.txt);## LIst of the text files in a directory. my $mw=new MainWindow; for my $i (0..$#dir) { $mw->Checkbutton(-text => $dir[$i], -command=>sub {push @a, $dir[$i]}) +->pack; } $mw->Button(-text=>"ok",-command=>sub {exit})->pack; MainLoop; print @a;
here in the above code @a prints none.
For the above mentioned problem can i use Win32::GUI's BrowseForFolder function.
Im struck with this one.
Please give your valuable suggestions.
Sorry for my English.
--Murugesan--
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk and MainLoop
by graff (Chancellor) on Jul 29, 2004 at 05:13 UTC | |
|
Re: Tk and MainLoop
by davidj (Priest) on Jul 29, 2004 at 05:06 UTC | |
|
Re: Tk and MainLoop
by PodMaster (Abbot) on Jul 29, 2004 at 04:56 UTC | |
by murugu (Curate) on Jul 29, 2004 at 05:05 UTC |