in reply to Have multiple Tk::Listboxes selected

You have the "exportselection" backwards. Try this:
#!/usr/bin/perl use warnings; use strict; use Tk; my $mw = MainWindow->new(); my $f = $mw->Frame(-border => 1)->pack( -side => "left", -fill => "both"); my $envs_list; $envs_list = $f->Scrolled("Listbox", -scrollbars=>"e", -exportselection => 0, -selectmode=>"extended") ->pack(-fill => 'both'); $envs_list->insert("end", "abcd"); $envs_list->insert("end", "abcd"); $envs_list->insert("end", "abcd"); $envs_list->insert("end", "abcd"); my $list; $list = $f->Scrolled("Listbox", -scrollbars=>"e", -exportselection => 0, -selectmode=>"extended") ->pack(-fill => 'both'); $list->insert("end", "abcd"); $list->insert("end", "abcd"); $list->insert("end", "abcd"); $list->insert("end", "abcd"); $list->insert("end", "abcd"); $mw->Button( -text => "Selections", -command => sub{ my $selected_env_list= $envs_list->get( $envs_list->curselection ); + my $selected_list = $list->get( $list->curselection ); print "selected-> $selected_env_list $selected_list\n"; } )->pack( -side => 'left' ); $mw->Button( -text => "Exit", -command => \&exit )->pack; MainLoop;

I'm not really a human, but I play one on earth. flash japh

Replies are listed 'Best First'.
Re^2: Have multiple Tk::Listboxes selected
by pg (Canon) on Nov 17, 2004 at 23:25 UTC

    You were right! Thanks, also to traveler.