fenetre TKinter et console
Bonjour
j'ai une classe
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| class graph(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)
self.x=20
self.y=23
def run(self):
self.canvas= Canvas(width=300, height=300, bg='white')
self.canvas.pack(expand=YES, fill=BOTH)
for i in range(1, 300, 20):
self.canvas.create_line(0, i, 300, i)
self.canvas.create_line(i, 0, i, 300)
self.canvas.create_oval(self.x,self.y,self.x+10,self.y+10)
mainloop()
def set(self,x1,y1):
self.x=x1
self.y=y1 |
et une autre classe
Code:
1 2 3 4 5 6 7 8 9
| class Decoder:
def __init__(self):
...
self.g = graph()
self.g.start()
...
def tracer(self,data):
self.g.set(data.x,data.y) |
au départ l'oval est tracé à son point initial, mais quand c'est updater par tracer, rien ne change
merci de l'aide