Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tk_circle_changer.py
- import Tkinter
- root = Tkinter.Tk()
- ypos_intvar = Tkinter.IntVar()
- ypos_intvar.set(100)
- def y_changed(new_intval):
- canvas.coords(circle_item, 100, 20 + int(new_intval), 200, 120 + int(new_intval))
- y_slider = Tkinter.Scale(root, from_=1, to=150, variable=ypos_intvar,
- label='Y-Position', command=y_changed)
- y_slider.grid(row=1, column=0, sticky=Tkinter.W)
- text = Tkinter.Label(root, text=' Drag Slider To Adjust Circle')
- text.grid(row=0, column=0)
- canvas = Tkinter.Canvas(root, width=300, height=300, background='#FFFFFF')
- canvas.grid(row=0, rowspan=2, column=1)
- circle_item = canvas.create_oval(150, 150, 150, 150,
- outline='#000000', fill='#00FFFF')
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement