How to draw a dash line in the Tkinter?

Fredrik Lundh fredrik at pythonware.com
Sun Nov 20 11:32:32 EST 2005


Ben Bush wrote:

> How to draw a dash line in the Tkinter?

use the dash option.  e.g.

    canvas.create_line(xy, fill="red", dash=(2, 4))
    canvas.create_line(xy, fill="red", dash=(6, 5, 2, 4))

(the tuple contains a number of line lengths; lengths at odd positions
are drawn, lengths at even positions are gaps.  note that not all com-
binations are supported on all platforms; if Tkinter cannot find an exact
match, it will pick a the "closest possible").

</F>






More information about the Python-list mailing list