in reply to Re: Perl-Tk MouseWheel support for Scale
in thread Perl-Tk MouseWheel support for Scale

Bingo!

With $scale->focus; the mousewheel works on Windows too just like on Linux!

Now I have to figure out how I can get FocusFollowsMouse on Windows as on Unix/Linux...

Replies are listed 'Best First'.
Re^3: Perl-Tk MouseWheel support for Scale ( Tk/DynaMouseWheelBind.pm )
by Anonymous Monk on Mar 06, 2015 at 23:56 UTC

    Well, focusFollowsMouse works on win32 just fine  perl -MTk -le " $mw = tkinit; $mw->Button->pack for 1..3; $mw->  focusFollowsMouse ; MainLoop; "

    But are you sure you want to do that?

    DynaMouseWheelBind allows scrolling at mouse position without changing focus :P

      DynaMouseWheelBind does not seem to work with Tk::Scale, I get:

      Tk::Error: Failed to AUTOLOAD 'Tk::Scale::yview' at /usr/lib/perl5/ven +dor_perl/5.10.0/i386-linux-thread-multi/Tk/Submethods.pm line 19 Carp::croak at /usr/lib/perl5/5.10.0/Carp.pm line 44 Tk::Widget::__ANON__ at /usr/lib/perl5/vendor_perl/5.10.0/i386-linux- +thread-multi/Tk/Widget.pm line 347 Tk::Widget::__ANON__ at Tk/DynaMouseWheelBind.pm line 54 <<DynaMouseWheel>> (command bound to event) Tk::Error: Failed to AUTOLOAD 'Tk::Scale::yview' at /usr/lib/perl5/ven +dor_perl/5.10.0/i386-linux-thread-multi/Tk/Submethods.pm line 19


      $mw->focusFollowsMouse seems to work fine with regards to mousewheel support for Scale widgets, but on Windows I get weird dotted boxes around Checkbuttons and Radiobuttons when the mouse passes over them, that persist even after the mouse is already over some other widget. :(

        DynaMouseWheelBind does not seem to work with Tk::Scale, I get:

        Ok, so Tk::Scale is not Scrollable ... no yview ... so you gotta bind your own binding or update the module