You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
importtkinterroot=tkinter.Tk()
text=tkinter.Text(root)
vbar=tkinter.Scrollbar(root)
vbar.pack(side=tkinter.RIGHT, fill=tkinter.Y)
text.pack(side=tkinter.LEFT, fill=tkinter.BOTH, expand=1)
text.config(yscrollcommand=vbar.set)
vbar.config(command=text.yview)
lines= ['This is the line number %d.\n'%iforiinrange(256)]
text.insert(tkinter.END, ''.join(lines))
defclick_trace(event):
text.insert('%d.%d'% (1, 0), 'Clicked at (%d,%d) on %s.\n'% (event.x, event.y, vbar.identify(event.x, event.y)))
vbar.bind('<Button-1>', click_trace)
root.mainloop()
When the slider is at the top of the scrollbar, clicking on its upper half doesn't allow dragging. The little script shows that the Scrollbar considers it as being on "through1" - in Tk the zone between the upper arrow and the "slider" - and not on "slider". Another consequence is that one can drag (up and down) the slider when clicking a little bit below the slider, on "through2" region. This issue doesn't manifest on Windows, where the scrollbar's arrows are shown.
I've seen this issue when trying to explore the reasons of another (34047, fixed) concerning the slider locked at the end of the scrollbar in IDLE.
The bug needs forwarding to the Tcl/Tk community. This is the script written in Tcl (run with tclsh8.6 script.tcl for Tcl 8.6 and tclsh8.5 script.tcl for 8.5):
package require Tk
scrollbar .vbar -width 10
text .edit
pack .vbar -side right -fill y
pack .edit -side left -fill both -expand 1
bind .vbar {<Button-1> } {
set cx %x
set cy %y
set dz [.vbar identify $cx $cy]
puts "You clicked at ($cx,$cy) on $dz.\n"
}
for {set i 1} {$i <= 256} {incr i} {
.edit insert "$i.0" "This is the line number $i.\n"
}
I will post two videos made on my MacBook, showing an expected behavior with Tk 8.5 and the scroll problems with Tk 8.6 on macOS.
vtudorache commented on Aug 10, 2018
vtudorachemannequin
MannequinAuthor
More actions
Now, the video for TK 8.5 showing expected behavior on macOS.
wordtech commented on Aug 15, 2018
wordtechmannequin
Mannequin
More actions
I just committed http://core.tcl.tk/tk/info/26a029b4a88ff97f, which fixes the scrolling issue in Tk. Running the test scripts here indicate the behavior is now correct; clicking several pixels below the bottom part of the scroll button causes the scroll to jump, instead of smoothly scrolling. (One must click the scroll button directly for smooth scrolling, which is the expected behavior.) The fix involved removing support for a small scroll button variant, which was causing the confusion; by sticking with a single variant, the normal size scroller, the behavior is correct and consistent.
FYI, for the python.org binary macOS installers for the 3.7.1rc1 and 3.6.7rc1 releases, I cherry-picked a post-8.6.8 development snapshot of Tk 8.6 that should include Kevin's fix. I would appreciate any feedback one way or the other whether this version of Tk 8.6 improves things over the vanilla 8.6.8 version used for the 3.7.0 and 3.6.6 releases. Thanks!
wordtech commented on Sep 27, 2018
wordtechmannequin
Mannequin
More actions
Ned, please hold off a bit on this--another developer is doing some final fine-tuning of the scrolling code so it fully passes Tk's test suite. I'm waiting for the final commit of this code any day now.
vtudorache commented on Sep 28, 2018
vtudorachemannequin
MannequinAuthor
More actions
The scroll problem (clicking on the upper half of the slider is taken as "through1") still persists for me on Mojave with 3.7.1 RC1 downloaded from python.org and including Tcl/Tk.
Activity
vtudorache commentedon Aug 10, 2018
Run the python script below.
When the slider is at the top of the scrollbar, clicking on its upper half doesn't allow dragging. The little script shows that the Scrollbar considers it as being on "through1" - in Tk the zone between the upper arrow and the "slider" - and not on "slider". Another consequence is that one can drag (up and down) the slider when clicking a little bit below the slider, on "through2" region. This issue doesn't manifest on Windows, where the scrollbar's arrows are shown.
I've seen this issue when trying to explore the reasons of another (34047, fixed) concerning the slider locked at the end of the scrollbar in IDLE.
vtudorache commentedon Aug 10, 2018
The bug needs forwarding to the Tcl/Tk community. This is the script written in Tcl (run with tclsh8.6 script.tcl for Tcl 8.6 and tclsh8.5 script.tcl for 8.5):
package require Tk
scrollbar .vbar -width 10
text .edit
pack .vbar -side right -fill y
pack .edit -side left -fill both -expand 1
.vbar configure -command {.edit yview}
.edit configure -yscrollcommand {.vbar set}
bind .vbar {<Button-1> } {
set cx %x
set cy %y
set dz [.vbar identify $cx $cy]
puts "You clicked at ($cx,$cy) on $dz.\n"
}
for {set i 1} {$i <= 256} {incr i} {
.edit insert "$i.0" "This is the line number $i.\n"
}
I will post two videos made on my MacBook, showing an expected behavior with Tk 8.5 and the scroll problems with Tk 8.6 on macOS.
vtudorache commentedon Aug 10, 2018
Now, the video for TK 8.5 showing expected behavior on macOS.
wordtech commentedon Aug 15, 2018
I just committed http://core.tcl.tk/tk/info/26a029b4a88ff97f, which fixes the scrolling issue in Tk. Running the test scripts here indicate the behavior is now correct; clicking several pixels below the bottom part of the scroll button causes the scroll to jump, instead of smoothly scrolling. (One must click the scroll button directly for smooth scrolling, which is the expected behavior.) The fix involved removing support for a small scroll button variant, which was causing the confusion; by sticking with a single variant, the normal size scroller, the behavior is correct and consistent.
vtudorache commentedon Aug 15, 2018
It seems that Kevin's fix solves the issues.
ned-deily commentedon Sep 27, 2018
New changeset adf4932 by Ned Deily in branch '3.6':
bpo-34370: Update Tk 8.6 used with macOS installers
adf4932
ned-deily commentedon Sep 27, 2018
New changeset d9cfe5e by Ned Deily in branch '3.7':
bpo-34370: Update Tk 8.6 used with macOS installers
d9cfe5e
ned-deily commentedon Sep 27, 2018
FYI, for the python.org binary macOS installers for the 3.7.1rc1 and 3.6.7rc1 releases, I cherry-picked a post-8.6.8 development snapshot of Tk 8.6 that should include Kevin's fix. I would appreciate any feedback one way or the other whether this version of Tk 8.6 improves things over the vanilla 8.6.8 version used for the 3.7.0 and 3.6.6 releases. Thanks!
wordtech commentedon Sep 27, 2018
Ned, please hold off a bit on this--another developer is doing some final fine-tuning of the scrolling code so it fully passes Tk's test suite. I'm waiting for the final commit of this code any day now.
vtudorache commentedon Sep 28, 2018
The scroll problem (clicking on the upper half of the slider is taken as "through1") still persists for me on Mojave with 3.7.1 RC1 downloaded from python.org and including Tcl/Tk.
ned-deily commentedon Sep 28, 2018
Thanks for testing, Vlad. And thanks for the followup, Kevin. I guess we'll wait to hear more from Kevin.
terryjreedy commentedon Oct 1, 2018
I just installed 3.7.1rc on current High Sierra and observed same as Vlad.
ned-deily commentedon Oct 13, 2018
New changeset f55c3ae by Ned Deily in branch '3.6':
bpo-34370: Revert to using released Tk 8.6.8 with macOS installers
f55c3ae
ned-deily commentedon Oct 13, 2018
New changeset d8b6425 by Ned Deily in branch '3.7':
bpo-34370: Revert to using released Tk 8.6.8 with macOS installers
d8b6425
wordtech commentedon Oct 18, 2018
Release of Tk 8.6.9 very soon; includes fixes for Mac scrolling as well as support for 10.14 macOS, with Dark Mode.