Tkinter: Clipping a canvas text item
__peter__ at web.de
Sat Feb 21 14:19:00 CET 2004
Is there a way to limit both width and height of a canvas text item?
My current workaround seems clumsy:
import Tkinter as tk
root = tk.Tk()
canvas = tk.Canvas(root, width=400, height=200, bg="white")
# simulate a clipped text item - never transparent :-(
s = "The long and winding road.."
lbl = tk.Label(root, text=s, anchor=tk.W, bg=canvas["bg"])
canvas.create_window(50, 80, width=100, height=20,
More information about the Python-list