[Tkinter-discuss] How to Reference many Canvas Ovals

electron at borgmeyer.com electron at borgmeyer.com
Thu May 4 14:33:22 CEST 2006


EHLO! Anyone have code showing how to reference many individual Canvas 
objects? I've built a large grid of ovals. I plan to have each oval change 
fill color numerous times based on various changing array values. I haven't 
yet successfully referenced these oval objects. Examples I've seen are all 
b1=canvas.create_oval() or similar. I thought tags might be an option, if I 
could serialize a tag specific to each oval... I'm used to thinking like 
this: 

for i in range(1,number+1)
n[i] = canvas.create_oval()
and
if variable[i] == "blue" then canvas.n[i].config(fill='blue') 

or something. Unfortunately that doesn't work --> SyntaxError: invalid 
syntax hehe 

HELP ME OBI-WAN!! YOU'RE MY ONLY HOPE!! 



More information about the Tkinter-discuss mailing list