Commit 04f51588 authored by Christian Fibich's avatar Christian Fibich Committed by Stefan Tauner
Browse files

(Windows) Fix scrolling

parent 50a21e22
......@@ -244,17 +244,17 @@ sub bind_mousewheel {
# bind the mouse wheel
if ($^O eq "MSWin32") {
# Windows passes the 'delta' itself
$mw->bind('<MouseWheel>' => [\&_wheel_handler, $mw]);
$mw->bind('<MouseWheel>' => [\&_wheel_handler, $mw, Tk::Ev('D')]);
} else {
$mw->bind('<4>' => [\&_wheel_handler, -1, $mw]);
$mw->bind('<5>' => [\&_wheel_handler, 1, $mw]);
$mw->bind('<4>' => [\&_wheel_handler, $mw, -1]);
$mw->bind('<5>' => [\&_wheel_handler, $mw, 1]);
}
}
sub _wheel_handler {
my ($event_widget, $val, $mw) = @_;
my ($event_widget, $mw, $val) = @_;
my $container;
......@@ -272,9 +272,9 @@ sub _wheel_handler {
next if $container != @{$mw->{'scrollable_widgets'}}[$index];
my $scrolled = $widget_to_scroll->Subwidget('scrolled');
if ($^O eq "MSWin32") {
$scrolled->yview(scroll=>(-$val/120)*SCROLL,'units');
$scrolled->yview("scroll",(-$val/120)*SCROLL,'units');
} else {
$scrolled->yview(scroll=>$val*SCROLL,'units');
$scrolled->yview("scroll",$val*SCROLL,'units');
}
goto END;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment