Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Tkinter_MouseMove.py
- #! /usr/bin/env python
- # -*- coding: euc-jp -*-
- import Tkinter as tk
- def mv0(event):
- x = event.x
- y = event.y
- c.coords('current', x - 10, y - 10, x + 10, y + 10)
- tag=c.gettags('current') #¿¿¤Î¥¿¥°Ì¾¤òÆÀ¤ë¡¥
- print tag
- c = tk.Canvas(width=300, height=200)
- c.pack()
- x=10; y=30
- for i in range(9):
- t='a'+str(i)
- c.create_oval(x, x, y, y,
- fill='red', tag=t)
- x=x+20; y=x+20
- cmd="c.tag_bind('"+t+"','<B1-Motion>',mv0)"
- exec cmd
- c.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement