Ratazong has asked for the wisdom of the Perl Monks concerning the following question:
Dear monks
I'm struggeling with creating a scrolled listbox in Tk: the code below works, however I'm not able to scroll with the arrow-keys nor with the mouse-wheel. Do I have to bind the events myself and code the related actions? Or am I just missing something?
Thanks for your help! rata
sub selectProjectDialog_newtest { $mw = shift; # store the main window my @project_choices = split(" ","Project1 Project2 Project3 Proje +ct4 Project11 Project12 Project13 Project14 ") ; my $projectSelection_tl= $mw->Toplevel( ); $projectSelection_tl->title("Select the project:"); $projectSelection_tl->Label(-text => 'Select the project Id:', + )->grid(-row => 5, -column => 10, -sticky => "w"); my $scrolled1 = $projectSelection_tl->Scrolled ("Listbox", -scrollbars => "se", -width => 50, -height => 4, -selectmode => "extended") ->grid(-row => 10, -column => 10, -columns +pan => 10, -rowspan => 10); $scrolled1->insert ("end", @project_choices); }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: TK Listbox: scrolling with keys/mousewheel
by Anonymous Monk on Aug 04, 2020 at 09:00 UTC | |
by Ratazong (Monsignor) on Aug 04, 2020 at 09:59 UTC |
Back to
Seekers of Perl Wisdom