469,290 Members | 1,913 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,290 developers. It's quick & easy.

about polygon

Why I got a black polygon in the following code?
How can I make it no-color filled?
Thanks!

import Tkinter

c = Tkinter.Canvas(width=220, height=220)
c.pack()
c.create_polygon(60,60,100,60,100,100,60,120)
c.mainloop()
Nov 22 '05 #1
10 2686
Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:
Why I got a black polygon in the following code?
How can I make it no-color filled?


Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,60)

Jan
Nov 22 '05 #2
Shi Mu wrote:
Why I got a black polygon in the following code?
How can I make it no-color filled?
Thanks!

import Tkinter

c = Tkinter.Canvas(width=220, height=220)
c.pack()
c.create_polygon(60,60,100,60,100,100,60,120)
c.mainloop()


You can set the color explicitly (use "" to denote transparency):

c.create_polygon(60,60,100,60,100,100,60,120, fill="", outline="black")

I don't know why that isn't the default.

Peter

Nov 22 '05 #3
Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:
Why I got a black polygon in the following code?
How can I make it no-color filled?


Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,60)

Jan
Nov 22 '05 #4
Shi Mu wrote:
Why I got a black polygon in the following code?
How can I make it no-color filled?
Thanks!

import Tkinter

c = Tkinter.Canvas(width=220, height=220)
c.pack()
c.create_polygon(60,60,100,60,100,100,60,120)
c.mainloop()


You can set the color explicitly (use "" to denote transparency):

c.create_polygon(60,60,100,60,100,100,60,120, fill="", outline="black")

I don't know why that isn't the default.

Peter

Nov 22 '05 #5
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:
Why I got a black polygon in the following code?
How can I make it no-color filled?


Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,60)

Jan

If so, what is the difference between create_line and create_polygon?
Thanks!
Nov 22 '05 #6
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:
Why I got a black polygon in the following code?
How can I make it no-color filled?


Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,60)

Jan

If so, what is the difference between create_line and create_polygon?
Thanks!
Nov 22 '05 #7
Shi Mu wrote:
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:

Why I got a black polygon in the following code?
How can I make it no-color filled?


Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,6 0)

Jan


If so, what is the difference between create_line and create_polygon?


Well, that one is filled and the other not?

Diez
Nov 22 '05 #8
Shi Mu wrote:
On 11/20/05, Jan Voges <ja*****@gmx.net> wrote:
Hi!

Am Sun, 20 Nov 2005 03:55:21 -0800 schrieb Shi Mu:

Why I got a black polygon in the following code?
How can I make it no-color filled?


Use create_line instead:
c.create_line(60,60,100,60,100,100,60,120,60,6 0)

Jan


If so, what is the difference between create_line and create_polygon?


Well, that one is filled and the other not?

Diez
Nov 22 '05 #9
Hi

Am Sun, 20 Nov 2005 04:45:52 -0800 schrieb Shi Mu:
If so, what is the difference between create_line and create_polygon?


create_polygon only creates closed polygons.

Jan
Nov 22 '05 #10
Hi

Am Sun, 20 Nov 2005 04:45:52 -0800 schrieb Shi Mu:
If so, what is the difference between create_line and create_polygon?


create_polygon only creates closed polygons.

Jan
Nov 22 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

BSOB
6 posts views Thread by BSOB | last post: by
6 posts views Thread by foonicate | last post: by
reply views Thread by =?Utf-8?B?U2ViYXN0aWFuIEZyw6Ruaw==?= | last post: by
8 posts views Thread by jpatchak | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.