FAQ
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.

Search Discussions

  • Rantingrick at Oct 30, 2010 at 5:53 pm
    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@0, height00)
    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 --#

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedOct 30, '10 at 2:21p
activeOct 30, '10 at 5:53p
posts2
users2
websitepython.org

2 users in discussion

Robert A. Lerche: 1 post Rantingrick: 1 post

People

Translate

site design / logo © 2022 Grokbase