in reply to Getting element from List box in Perl tk

Hi,

First of all you should always start your program with

use strict; use warnings;

You are looking for something like this:

$lb -> bind('<Double-1>'=> sub { print $_[0]->get($_[0]->curselection), + "\n"; }, );
See Tk::Listbox for documentation of the get() and  curselection() methods.

Cheers, Christoph

Replies are listed 'Best First'.
Re^2: Getting element from List box in Perl tk
by vr786 (Sexton) on Nov 24, 2010 at 12:33 UTC

    Thank you very much, now onwards i will follow the rules of Tk