1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| import Tkinter
class unclient(Tkinter.Toplevel):
def __init__(self):
Tkinter.Toplevel.__init__(self)
Tkinter.Label(self, image=img2).pack()
Tkinter.Button(self, text="Quitter", command=self.destroy).pack()
root = Tkinter.Tk()
img1 = Tkinter.PhotoImage(file='ZB.gif')
img2 = Tkinter.PhotoImage(file='ZR.gif')
canv = Tkinter.Canvas(root, width=100, height=100)
canv.pack()
canv.create_image(50, 50, image=img1)
r2=unclient()
r3=unclient()
# Ce n'est pas les mêmes toplevels
print id(r2)
print id(r3)
Tkinter.Button(root, text="Quitter", command=root.destroy).pack()
root.mainloop() |