from Tkinter import *
class monAppli(Frame):
def __init__(self,boss=None,larg=100,haut=150):
Frame.__init__(self)
self.configure(width=larg,height=haut)
self.can=Canvas(self,width=larg,height=haut,bg='ivory')
self.can.pack(side=TOP)
self.cercle=self.can.create_oval(50,50,150,150,fill="black" )
Scale(self,orient=HORIZONTAL,width=20,label="taille",from_=10.,to=200.,showvalue=1,command=self.retaille).pack()
def retaille(self,size):
self.can.delete(self.cercle)
self.cercle=self.can.create_oval(50,50,50+int(size),50+int(size),fill="black" )
##code test###
if __name__=="__main__":
root=Tk()
monAppli(root,300,300).pack()
root.mainloop()
|