Canvas rectangle filling

Abel Daniel abli at freemail.hu
Sat Jun 14 14:15:41 EDT 2003


Well, a trivial work-around is to create _two_ rectangles:

canvas.create_rectangle(100,150,150,200,fill=<bgcolor>,outline=<bgcolor>)
canvas.create_rectangle(100,150,150,200,fill='black', stipple="@lines.xbm")
The first one will cover whatever is beneath.

The <bgcolor> at the first rectangle should be set to the canvas's
background color. The default background color is '#d9d9d9' (at least
for me on Linux, might be different elsewhere, or depending on the
screen's bitdepth, but I doubt it).

Abel Daniel





More information about the Python-list mailing list