
scrollbar "moveto" fraction computed wrong
Tk 8.2.1 Bug: Generated by Scriptics' bug entry form at
http://www.*-*-*.com/
Responses to this post are encouraged.
------
Submitted by: John Seal
OperatingSystem: Macintosh
OperatingSystemVersion: Mac OS 9
Machine: PowerCenter Pro 210
Extensions: Tcl/Tk 8.2.1
CustomShell: Modified Tk8.2.shlb to allow
drag-and-drop opening of script files
Synopsis: scrollbar "moveto" fraction computed wrong
ReproducibleScript:
Run this script and drag the scrollbar thumbs, observing the "moveto" fraction
in relation to where you are in the scrollbar trough:
proc report {where action amount args} {
$where configure -text [format "%s %f %s" $action $amount $args]
$where set $amount $amount
Quote:
}
scrollbar .vsb -orient vertical -command [list report .vmsg]
pack .vsb -side right -fill y
scrollbar .hsb -orient horizontal -command [list report .hmsg]
label .h -text "Horizontal:" -height 2 -anchor sw
label .hmsg -width 30
label .v -text "Vertical:" -height 2 -anchor sw
label .vmsg -width 30
pack .h .hmsg .v .vmsg .hsb -fill x
ObservedBehavior:
The Mac OS Appearance control panel allows the user to specify where the scroll
arrows appear in scrollbars: one arrow at each end (the default), both arrows at
one end only, or both arrows at both ends (my preference). Tk apparently always
computes the "moveto" fraction based on the assumption that there is one arrow
at each end. If they are both at one end, or both at both ends, you sometimes
have to drag into the scroll arrow areas in order to get to 0.0 or 1.0.
Note: If you have Mac OS set to display both arrows at both ends, you can test
this behaviour without having to change the Appearance control panel settings.
Just make the window small enough, and the extra arrows will go away. I think
the vertical scrollbar will come up this way by default; making the window
bigger will cause it to get the extra arrows, if that's your pref setting.
Also, the thumb is not proportional, even though I have set that pref, too, and
other scrollbars in other apps are pro
DesiredBehavior:
I expect the "moveto" fraction to reflect the thumb's position in the visible
trough, taking into account the scroll arrow preferences, and that the thumb be
proportional when the corresponding pref is set.
This is on a PowerCenter Pro 210 running Mac OS 9 with 96MB RAM and VM off