Tkinter Scrollbar bad behavior [re. bug #10232]

Discussion in 'Python' started by Robert A. Lerche, Oct 30, 2010.

  1. 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.
     
    Robert A. Lerche, Oct 30, 2010
    #1
    1. Advertising

  2. Robert A. Lerche

    rantingrick Guest

    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 --#
     
    rantingrick, Oct 30, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. codecraig

    Tkinter and Scrollbar

    codecraig, Apr 19, 2005, in forum: Python
    Replies:
    0
    Views:
    353
    codecraig
    Apr 19, 2005
  2. Replies:
    1
    Views:
    945
  3. Dustan

    Tkinter Scrollbar not working

    Dustan, Jan 2, 2006, in forum: Python
    Replies:
    8
    Views:
    558
    Dustan
    Jan 3, 2006
  4. rantingrick
    Replies:
    44
    Views:
    1,223
    Peter Pearson
    Jul 13, 2010
  5. Alex

    ScrollBar? Does it exist just WEB ScrollBar Control?

    Alex, Apr 1, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    272
    Alvin Bruney [MVP]
    Apr 4, 2004
Loading...

Share This Page