use strict; use warnings; use Tk; my $mw = MainWindow->new(); my $lbox = $mw->Listbox()->pack(); my @list = ( "a", "b", "c", "d", "e", "f" ); $lbox->insert('end', @list ); $lbox->selectionSet('1'); #$mw->Button(-text => "Set!", -command=>sub{$lbox->selectionSet('2');})->pack();#to test if sectionSet works with <> $lbox->bind('<>', sub{warn "ListBox changed\n"} ); $mw->MainLoop;