Tkinter Scrollbar bad behavior [re. bug #10232]

R

Robert A. Lerche

I am trying to use Tkinter to create a custom scrollable widget,
similar to a list box but with 3 Entry fields per row. In the real
application each Entry has a separate input validation routine.

I have placed a test case file in the bug I reported:
http://bugs.python.org/issue10232

The most serious issue is the behavior on MS Windows. In my sample
program the scroll bar slider has a problem. When slowly moved down
it works for the first few rows but fails near the bottom of travel.
Near the bottom it rapidly generates "moveto" commands that jump
between rows 4 and 7, causing the display to flash until button 1 is
released.

This behavior does not occur on Linux -- there scrolling using the
slider is smooth top to bottom.

Terry Reedy confirmed this behavior still exists in Python 3 (I tested
in 2.7 on Windows and 2.6.2 on Linux.

He suggested I post here as there may be someone more familiar with
Tkinter who could shed some light. Thanks in advance.
 
R

rantingrick

Robert,

First and foremost if you wish to scroll a window then why not use the
TIX.ScrolledWindow widget instead. It even shows and hides the
scrollbar when necessary.

#-- Start Script --#
from Tix import *
#from Tkconstants import *

class App(Tk): # Must use Tk for Tix incompability
def __init__(self):
Tk.__init__(self)
self._createWidgets()

def _createWidgets(self):
swin = ScrolledWindow(self, width=400, height=300)
swin.pack(fill=BOTH, expand=1)
frame = swin.window
col, row = 0,0
for row in range(100):
for col in range(3):
w=Button(frame, text='This is button (%02d, %02d)' %
(col, row))
w.grid(row=row, column=col)
col += 1
row += 1


if __name__ == '__main__':
app = App()
app.mainloop()
#-- End Script --#
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top