I am using ActivePerl 5.12.2 on Windows 7. I noticed that when I attach a scrollbar to either a listbox or a tree that the mouse wheel will allow me to scroll down the list, but not allow me to scroll up the list.

Here is a sample program using a listbox:

#!/usr/bin/perl -w use strict; use Tkx; my $mw = Tkx::widget->new("."); my $lb = $mw->new_tk__listbox(-height => 10); $lb->insert("end", 1..100); $lb->g_grid(-column => 0, -row => 0); my $sb = $mw->new_ttk__scrollbar(-orient => 'vertical', -command => [$ +lb, 'yview']); $sb->g_grid(-column => 1, -row => 0, -sticky => "ns"); $lb->configure(-yscrollcommand => [$sb, "set"]); Tkx::MainLoop();

I don't think I am doing anything wrong here, but thought I would ask the Monks for their thoughts. I find that I am now looking at binding MouseWheel events to the listbox and spending a lot more time on this than may even be necessary. Can somebody confirm the behavior with the script above?

Thanks!


In reply to Perl::Tkx Mousewheel Scrolling by Zucan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.