New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tkinter scrollbar issues on Mac. #78977
Comments
bpo-34047 was about scrollbar issues on MacOS in 3.7.0 and 3.6.6. One was due to an IDLE bug, which was fixed on the issue. Others, which can be demonstrated in the pure tkinter code below, are the subject of this issue.
Vlad Tudorache posted the code below as msg323349 of bpo-34047 and attached as tktest.py, along with tkinter_scroll_issues.mov. import tkinter
root = 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' % i for i in range(256)]
text.insert(tkinter.END, ''.join(lines))
def click_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() "Clicking at the top on the slider shows that the Scrollbar considers it as being on "through1" (in Tk the zone between the upper arrow and the "slider") and NOT on the "slider". Please, play with the script (python3 tktest.py) and see the results for yourselves." |
Ned, is the version of tcl/tk on Mac the same in 3.8.0b1 and upcoming 3.7.4 as it was last September? (8.6.8 in 3.7.3, not sure in Sept.) |
As far as I recall, we have only ever shipped 8.6.8 in final releases since we started providing a built-in Tcl/Tk in the python.org macOS installers as of 3.7.0, 3.6.8, and 2.7.16 (https://www.python.org/download/mac/tcltk/). There was the disastrous attempt to update to 8.6.9+ during the 3.7.2rc phase which we ultimately reverted prior to 3.7.2 final, as documented in bpo-35485. Since then, there do not seem to have been any official releases of 8.6.9 so we remain with 8.6.8. It would probably be a good thing for someone to work with the Tk folks on seeing whether the problems seen are being resolved but it's not something I expect to have time for in the foreseeable future. |
That is: there have been no official releases of Tk past 8.6.9.1 which was tried, along with the then current HEAD of the 8.6 maintenance branch, back in December. |
I have not successfully reproduced the issue here with tkinter 3.7.3 using 8.6.9.1 or recent core-8-6-branch on macOS Mojave. I understand the reporter of this issue believed this was not an upstream Tk issue. However there's a recently opened upstream ticket relating to scrollbars on Aqua which may be of interest: At the moment, one of the Tk Aqua developers appears to advise against using the normal (non-Ttk) scrollbar at all on macOS because it has never worked properly and likely will not be fixed, and instead suggests using the new Ttk scrollbar implementation, which should be available in 8.6.10. |
As far as I recall, the scrollbar issue did seem to be fixed in 8.6.9.1 so that was one plus for updating. But, as described in bpo-35485, updating introduced other, far more serious new problems so we decided to revert to 8.6.8 and wait for a new official release. |
This should probably be closed as 3rd party, but someone needs to verify that the bug is in tk. In the meanwhile, let it sit. Vlad's test works perfectly on Windows with 8.6.9. In multiple tries, mouse at (x, Y <= 16) is top arrow, (x, y >= 17) is slider. |
Christopher, I submitted before seeing your message. Thank you for the additional info, which verifies that this is an upstream issue. Apparently, the current ttk.Scrollbar on the 8.6.8 we currently deliver should sort of work. |
I'm not sure if that is the case, though I have not tested with 8.6.8 (I do not currently have access to High Sierra or earlier). Based on a comment by the developer (Marc Culler) in https://core.tcl-lang.org/tk/tktview?name=0d63621b6c it sounds like the Ttk scrollbar is a completely new implementation for 8.6.10, whereas before (8.6.9.1? 8.6.8?) any code requesting a Ttk scrollbar on Aqua normally got a non-Ttk scrollbar instead. |
IDLE currently uses whatever 'ttk.Scrollbar' is. Unlike Windows, there are no top and bottom arrows, but this is also true with Safari, so I presume normal. "Clicking trough near slider has no effect". True for large file and small slider, not for medium file with large slider. "Clicking top of slider treated as clicking on trough above slider. True for about top 2 mm of the slider, when click and hold does not grab the slider. If the slider is not at the top, it moves up. So ttk slider becomes less useful as the file gets large, and only half usable at about 3000 lines and up. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: