aplonis has asked for the wisdom of the Perl Monks concerning the following question:

My copy of Mastering Perl/Tk said TList indexed just like Listbox. But I find nothing on how to retrieve the current selection. I tried to retrieve like for Listbox thus,

@foo = tlist_foo->curselection();
but it fails like so
Tk::Error: Failed to AUTOLOAD 'Tk::TList::curselection' at c:/Perl/sit +e/lib/Tk/Derived.pm line 461
.

How do I retrieve for TList, please?

Replies are listed 'Best First'.
Re: Tk TList, no cursellection ?
by tall_man (Parson) on Jun 14, 2003 at 13:57 UTC
    What you want (as documented in Tk::TList) is this:
    @foo = $tlist_foo->info('selection');
    (Your example code is missing a '$' but I assume that's a typo because your script wouldn't have compiled that way).