Tkinter: scrollbar in grid-managed frame

jepler at jepler at
Wed Nov 16 22:47:48 CET 2005

Tkinter "frame"s don't scroll.  Instead, you need to use something like
bwidget's "ScrollableFrame" widget.  You may want to combine this with
bwidget's "ScrolledWindow".

Below is an example which uses my "pybwidget" package, available at
# ----------------------------------------------------------------------
import Tkinter, bwidget
t = Tkinter.Tk()
s = bwidget.ScrolledWindow(t, auto="vertical", scrollbar="vertical")
f = bwidget.ScrollableFrame(s, constrainedwidth=True)
g = f.getframe()

for i in range(20):
    Tkinter.Label(g, text="Field %d:  " % i).grid(row=i, column=0, sticky="w")
    Tkinter.Entry(g, width=25).grid(row=i, column=1, sticky="ew") 
g.grid_columnconfigure(1, weight=1)

s.pack(fill="both", expand=1)
# ----------------------------------------------------------------------


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <>

More information about the Python-list mailing list