Steven D'Aprano <steve+pyt...@pearwood.info> added the comment:

Replicated on Linux, Python 3.10.

It looks like mousewheel scrolling jumps by the wrong amount as it pages down 
(or up), and consequently some lines never appear in the view area.

I ran a slightly modified version of the code that had 16 entries instead of 
just seven. By default, just three entries are visible at a time. If we number 
the lines 1-16, and start with lines 1-3 visible, then we get:

* Initial view: lines 1, 2, 3 visible, 4-16 below the view area.
* Scrollwheel down.
* Lines 6-8 visible, 1-5 above the view area, 9-16 below.
* Scrollwheel down.
* Lines 11-13 visible, 1-10 above the view area, 14-16 below.
* Scrollwheel down.
* Lines 14-16 visible, 1-13 above the view area.

So the scrollwheel scrolls down by: 5 lines, 5 lines, 3 lines.

Going back the otherway, the scrollwheel scrolls up by 5, 5, 3.

Why five lines? My guess is that it might have something to do with 16//3 = 5.

I don't know if this is something we can fix, or we're stuck with whatever 
tk/tcl does.

I don't know if this is related, or should be a separate issue, but I see that 
the keyboard PageUp and PageDown keys don't scroll up or down by a page, but by 
a single line -- and they don't correctly highlight the selected line either.

Paging should scroll up or down by N-1 lines, where N is the number of visible 
lines in the view area.

Likewise for clicking in the scrollbar's PageUp/PageDown region, which also 
scrolls by a single line.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue46803>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to