Tk Library Source Code

View Ticket
Login
Ticket UUID: 3317772
Title: ListBox does not allow scrolling to last line on Windows 7
Type: Bug Version: None
Submitter: zoro2 Created on: 2011-06-17 08:52:50
Subsystem: bwidget Assigned To: oehhar
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2011-06-24 16:25:31
Resolution: Accepted Closed By: oehhar
    Closed on: 2011-06-24 09:25:31
Description:
Hi,

Example below shows the issue:

catch {destroy .x}
toplevel .x
ScrolledWindow .x.w
pack .x.w -fill both -expand 1
ListBox .x.w.l -deltay 25
wm geometry .x 400x169
for {set i 0} {$i < 10} {incr i} {
    .x.w.l insert end i$i -text TEST$i
}
.x.w setwidget .x.w.l

When using scrollbar, you can't scroll down to see entire last entry. Works fine on Linux, not sure about other platforms.
User Comments: oehhar added on 2011-06-24 16:25:30:
Koen and Wojciech reevaluated:
- extra space (felt by me) is ok
- resizing and keep last row was not related to the patch.

Bug closed, thank you all,
Harald

oehhar added on 2011-06-23 15:04:26:

File Added - 415716: bwidget_patch_010.png

oehhar added on 2011-06-23 15:03:34:
Oh, I have made an error and applied the wrong patch.

For me, the patch has the following issues:

1) the space below the last entry is far to much for me. (see attached foto)
2) scrolling down to the end and resizing the window to get smaller:
  did keep the last row in view before.
  This is not the case any more.

Could you reinvestigate the patch, please ?

oehhar added on 2011-06-23 14:40:35:
Summary of private Mails about the attached patches:

-Ideas by WC-
Date: Fri, 17 Jun 2011 11:05:29 +0200
From: Wojciech Kocjan
I just filed a bug so I don't loose the example. I investigated the
issue and have been wondering - would it make sense to just allow
configuring smooth scrolling?

It would make sense since with 8.5, smooth scrolling is also the case
for other widgets.

Do you think it makes sense? Do you think it makes sense for both tree
and list? Do you think it can pose any problem?

Do you know of any other solution that would resolve the Windows issue
without such a rework?

-About the first patch-
Date: Fri, 17 Jun 2011 17:04:48 +0200
From: Wojciech Kocjan <[email protected]>
It expands region by number of pixels needed below list - i.e. if size
is 163px (without borders), deltay is 25, then I am adding 13px
because this is how much is needed below the list and will be shown if
you move all the way down.

-Modified patch by Koen Danckaert-
-------- Original-Nachricht --------
Date: Tue, 21 Jun 2011 17:57:15 +0200
From: Koen Danckaert
I basically agree with the patch, but I think it can be simplified.

The original version already contained code to increase the scrollregion, but this code can be considered wrong since it did not work. So I would leave out that part and replace it by the new code.

Also, the int() conversions are not needed because they already operate on integer arguments?

With a bit more code refactoring I arrived at the attached patch, which works for me. Note, line numbers are different because I still work with BWidget 1.9.0, and I only did the Listbox part (not Tree).

-Modified patch by WC-
-------- Original-Nachricht --------
Date: Wed, 22 Jun 2011 16:51:18 +0200
From: Wojciech Kocjan
Yes, that fix worked jut fine. Attached is patch against 1.9.4.

-HaO-
I specially like, how exact the scrollbar "jumps" now, if the scrolling region is at the end and the window is resized. Good work !
Fix committed, thank you all !

oehhar added on 2011-06-23 14:19:54:

File Added - 415713: 010-BWidget-1.9.4-scrollregion-fix.patch

oehhar added on 2011-06-23 14:19:03:

File Added - 415712: BWidget-scrollregion-fix.patch

oehhar added on 2011-06-23 14:17:57:

File Added - 415711: BWidget-scrollregion-fix.patch

oehhar added on 2011-06-19 19:14:36:
Thank you addressing this always annoying issue.
For me, I required another window size to show the effect, but I know it. I never liked, if the scrollbar jumped back to 75% after having pulled it to 100%.

There was a patch by private E-Mail

Attachments: