Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Marvellous Monks,
Im selecting more than one item from the list box. But when i print the index of the selected contents it is not printing what i need.
curselection() method is not working for me. May be i have missed something so basic in Tk. Please help me.
my $mw=new MainWindow; $lb = $mw->Listbox( -selectmode =>"multiple")->pack; $lb->insert('end', @dir); my @selected = $lb->curselection; $mw->Button(-text=>"ok",-command=>[$mw => 'destroy'] )->pack; MainLoop; print scalar @selected;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: curselection in listbox
by strat (Canon) on Aug 02, 2004 at 06:24 UTC | |
|
Re: curselection in listbox
by davidj (Priest) on Aug 02, 2004 at 06:27 UTC |