New submission from pez <4coreylo...@gmail.com>: tkinter.Scrollbar(orient='horizontal').fraction() gives you an accurate representation of how far along the mouse is in the trough. The output is 0.0 when the mouse is on the first pixel of the trough. The output is 1.0 when the mouse is on the last pixel of the trough.
tkinter.ttk.Scrollbar(orient='horizontal').fraction() believes the trough is 16 pixels shorter than it is. The output is 0.0 when the mouse is on the first pixel of the trough. However, the output is greater than 1.0 when the mouse is on the last pixel of the trough. This extra 16 pixels is static, so the behavior is the same regardless of how wide the scrollbar is. While possibly coincidental, it's interesting that the 16 pixels is also close to the default width of the scrollbar. This is happening for me on Windows 7. Did not test vertical orientation. ---------- components: Tkinter files: ttk_scroll_bug.py messages: 317836 nosy: pez priority: normal severity: normal status: open title: tkinter.ttk.Scrollbar.fraction() is inaccurate, or at least inconsistent compared to the non ttk version type: behavior versions: Python 3.6 Added file: https://bugs.python.org/file47617/ttk_scroll_bug.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33665> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com