tkScrolledFrame is a scrollable frame widget for Python + Tkinter.
Usage
tkScrolledFrame consists of a single module, tkscrolledframe
(note the module name is lowercase), which exports a single class, ScrolledFrame
.
A brief example program:
from tkinter import *
from tkscrolledframe import ScrolledFrame
root = Tk()
sf = ScrolledFrame(root, width=640, height=480)
sf.pack(side="top", expand=1, fill="both")
sf.bind_arrow_keys(root)
sf.bind_scroll_wheel(root)
inner_frame = sf.display_widget(Frame)
num_rows = 16
num_cols = 16
for row in range(num_rows):
for column in range(num_cols):
w = Label(inner_frame,
width=15,
height=5,
borderwidth=2,
relief="groove",
anchor="center",
justify="center",
text=str(row * num_cols + column))
w.grid(row=row,
column=column,
padx=4,
pady=4)
root.mainloop()
For detailed documentation, try python -m pydoc tkscrolledframe
.