perltux has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use Tk; use Tk::BrowseEntry; my $mw=tkinit(); my $var='opt2'; my $b=$mw->BrowseEntry(-label => "Choose:", -variable => \$var, -style => 'MSWin32', -listheight => 5, -browsecmd => sub{ print STDOUT $var."\n" } ); $b->insert("end", "opt1"); $b->insert("end", "opt2"); $b->insert("end", "opt3"); $b->insert("end", "opt4"); $b->insert("end", "opt5"); $b->insert("end", "opt6"); $b->insert("end", "opt7"); $b->insert("end", "opt8"); $b->insert("end", "opt9"); $b->insert("end", "optA"); $b->insert("end", "optB"); $b->insert("end", "optC"); #my $lbx=$b->Subwidget("slistbox")->Subwidget("yscrollbar"); #my $lbx=$b->Subwidget("slistbox")->Subwidget("scrolled"); #my $lbx=$b->Subwidget("slistbox")->Subwidget("listbox"); #my $lbx=$b->Subwidget("choices"); my $lbx=$b->Subwidget("slistbox"); $lbx->bind('<MouseWheel>',[sub{$_[0]->yview('scroll',-($_[1]/120)*3,'u +nits')}, Ev("D")]); $b->pack; MainLoop;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Tk::BrowseEntry listbox scrollbar with Mousewheel on Windows
by beech (Parson) on Apr 03, 2017 at 03:47 UTC | |
by perltux (Monk) on Apr 03, 2017 at 13:09 UTC | |
by beech (Parson) on Apr 03, 2017 at 18:47 UTC | |
by perltux (Monk) on Apr 04, 2017 at 00:15 UTC | |
by beech (Parson) on Apr 04, 2017 at 00:53 UTC | |
| |
|
Re: Tk::BrowseEntry listbox scrollbar with Mousewheel on Windows
by kcott (Archbishop) on Apr 03, 2017 at 10:54 UTC | |
by perltux (Monk) on Apr 03, 2017 at 13:00 UTC |