in reply to Tlist get selected

I know that you can get a list of the selected item(s) like so:
my @index = $tlist->info('selection');
But i have no idea how to get, say, the text of that/those particular item(s). There is no get() method for Tk::TList and none of the other available methods in the docs are looking good. I am starting to believe that you are not suppose to need to have a handle on the selected object ... hopefully someone will come along soon and prove this wrong. (and hopefully someone will finally write some decent docs for Tk!)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Tlist get selected
by PodMaster (Abbot) on Sep 07, 2003 at 20:22 UTC
    Once upon a time, I wrote the following ($l is a Tk::TList, Scrolled)
    sub KosherINC { my $l = shift; @INC = (); if( $l->index('end') ) { # index ain't documented (grr) for(0 .. $l->index('end') ) { push @INC, $l->entrycget($_ => '-text'); } } }
    What it does is push onto @INC all the entries in the list. Isn't Tk wonderful? {grin}

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      Hello PodMaster! You are the great .$tl->entrycget($index->'-text') is work pretty well. Everybody who are looking for this ,use this and thanks to PodMaster Thanks,