Discussion:
ttk::treeview scroll bug on Mac?
(too old to reply)
Eckhard Lehmann
2008-01-02 16:48:09 UTC
Permalink
Hi,

using ActiveTcl 8.5 on OS-X Leopard x86, I can not scroll upwards using
the mouse wheel. To reproduce, please try:

package re Tk
ttk::treeview .tv
ttk::scrollbar .sb -command ".tv yview" -orient vert
.tv configure -yscrollcommand ".sb set"
pack .tv .sb -side left -fill y
for {set i 0} {$i < 100} {incr i} {
.tv insert "" $i -text "node $i"
}

Then click inside the treeview and move the mouse wheel... normally (on
Windows, Linux) the treeview is scrolled up and down, but my experience
is that only the scrolling down works. This is only for ttk::treeview
(as far as I see... text works) and for both, ttk::scrollbar *and*
tk::scrollbar. So I suspect the troublemaker is ttk::treeview.

Is it just me or do others have this problem too? Is it a bug that needs
to be filed or is it known already?


TIA
Eckhard
Neil Madden
2008-01-02 19:31:34 UTC
Permalink
Post by Eckhard Lehmann
Hi,
using ActiveTcl 8.5 on OS-X Leopard x86, I can not scroll upwards using
package re Tk
ttk::treeview .tv
ttk::scrollbar .sb -command ".tv yview" -orient vert
.tv configure -yscrollcommand ".sb set"
pack .tv .sb -side left -fill y
for {set i 0} {$i < 100} {incr i} {
.tv insert "" $i -text "node $i"
}
Then click inside the treeview and move the mouse wheel... normally (on
Windows, Linux) the treeview is scrolled up and down, but my experience
is that only the scrolling down works. This is only for ttk::treeview
(as far as I see... text works) and for both, ttk::scrollbar *and*
tk::scrollbar. So I suspect the troublemaker is ttk::treeview.
Is it just me or do others have this problem too? Is it a bug that needs
to be filed or is it known already?
I've been having the same problem on my MacBook. Seems like a bug to me.

-- Neil
Neil Madden
2008-01-02 19:58:32 UTC
Permalink
...
Post by Neil Madden
Post by Eckhard Lehmann
Is it just me or do others have this problem too? Is it a bug that
needs to be filed or is it known already?
I've been having the same problem on my MacBook. Seems like a bug to me.
The bug is in tile/library/treeview.tcl:61 which defines the
<MouseWheel> binding using the delta values produced on Windows. It
should be:

if {[tk windowingsystem] eq "aqua"} {
bind Treeview <MouseWheel> { %W yview scroll [expr {-%D}] units }
} else {
bind Treeview <MouseWheel> { %W yview scroll [expr {-
(%D/120)*4}] units }
}

If you post the bug report, I'll post a patch -- assuming we're ok to
use [tk windowingsystem] here?

-- Neil
Eckhard Lehmann
2008-01-02 20:45:18 UTC
Permalink
Post by Neil Madden
The bug is in tile/library/treeview.tcl:61 which defines the
<MouseWheel> binding using the delta values produced on Windows. It
if {[tk windowingsystem] eq "aqua"} {
bind Treeview <MouseWheel> { %W yview scroll [expr {-%D}] units }
} else {
bind Treeview <MouseWheel> { %W yview scroll [expr {- (%D/120)*4}]
units }
}
If you post the bug report, I'll post a patch -- assuming we're ok to
use [tk windowingsystem] here?
Thanks a lot, this works. Here is the bug id in Tk: 1862692
(http://sourceforge.net/tracker/?group_id=12997&atid=112997)

Eckhard

Loading...