ListBox has working scroll wheel. It first allows itself to
get the focus when clicked on:
bind ListBoxFocus <1> [list focus %W]
Then, it uses BWidget's built in wheel bindings:
## Let any click within the canvas focus on the canvas
so that
## MouseWheel scroll events will be properly handled by the
## canvas.
if {[Widget::cget $path -autofocus]} {
bindtags $path.c [concat [bindtags $path.c] ListBoxFocus]
BWidget::bindMouseWheel $path.c
}
Which is listed below:
# BWidget::bindMouseWheel --
#
# Bind mouse wheel actions to a given widget.
#
# Arguments:
# widget - The widget to bind.
#
# Results:
# None.
proc BWidget::bindMouseWheel { widget } {
bind $widget <MouseWheel> {%W yview scroll [expr
{-%D/24}] units}
bind $widget <Shift-MouseWheel> {%W yview scroll [expr
{-%D/120}] pages}
bind $widget <Control-MouseWheel> {%W yview scroll [expr
{-%D/120}] units}
Logged In: YES
user_id=1312775
ListBox has working scroll wheel. It first allows itself to
get the focus when clicked on:
bind ListBoxFocus <1> [list focus %W]
Then, it uses BWidget's built in wheel bindings:
## Let any click within the canvas focus on the canvas
so that
## MouseWheel scroll events will be properly handled by the
## canvas.
if {[Widget::cget $path -autofocus]} {
bindtags $path.c [concat [bindtags $path.c] ListBoxFocus]
BWidget::bindMouseWheel $path.c
}
Which is listed below:
# BWidget::bindMouseWheel --
#
# Bind mouse wheel actions to a given widget.
#
# Arguments:
# widget - The widget to bind.
#
# Results:
# None.
proc BWidget::bindMouseWheel { widget } {
bind $widget <MouseWheel> {%W yview scroll [expr
{-%D/24}] units}
bind $widget <Shift-MouseWheel> {%W yview scroll [expr
{-%D/120}] pages}
bind $widget <Control-MouseWheel> {%W yview scroll [expr
{-%D/120}] units}
bind $widget <Button-4> {event generate %W <MouseWheel>
-delta 120}
bind $widget <Button-5> {event generate %W <MouseWheel>
-delta -120}
}