Re: Tkinter: Clipping a canvas text item
From: robin bryce (robin_at_wiretooth.com)
Date: 02/21/04
- Next message: robin bryce: "Re: running fastcgi on windows?"
- Previous message: David Opstad: "Linguistically correct Python text rendering"
- In reply to: Peter Otten: "Tkinter: Clipping a canvas text item"
- Next in thread: robin bryce: "Re: running fastcgi on windows?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sat, 21 Feb 2004 16:35:23 +0000 To: python-list@python.org
oops. wrong thread. apologies.
On Sat, 2004-02-21 at 13:19, Peter Otten wrote:
> 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")
> canvas.pack()
>
> # 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,
> window=lbl,
> anchor=tk.NW)
>
> root.mainloop()
>
> Thanks,
> Peter
- Next message: robin bryce: "Re: running fastcgi on windows?"
- Previous message: David Opstad: "Linguistically correct Python text rendering"
- In reply to: Peter Otten: "Tkinter: Clipping a canvas text item"
- Next in thread: robin bryce: "Re: running fastcgi on windows?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|