comparison flax/tracker @ 193:e16b8ca470d8

distance calc change
author drewp
date Mon, 31 May 2004 07:31:32 +0000
parents 5aa7cffe68d0
children 8c7f136120a9
comparison
equal deleted inserted replaced
192:14c67d11027e 193:e16b8ca470d8
17 import Tkinter as tk 17 import Tkinter as tk
18 18
19 defaultfont="arial 8" 19 defaultfont="arial 8"
20 20
21 def pairdist(pair1,pair2): 21 def pairdist(pair1,pair2):
22 return sqrt((pair1[0]-pair2[0])**2+(pair1[1]-pair2[1])**2) 22 return pair1.dist(pair2)
23 23
24 def canvashighlighter(canvas,obj,attribute,normalval,highlightval): 24 def canvashighlighter(canvas,obj,attribute,normalval,highlightval):
25 """creates bindings on a canvas obj that make attribute go 25 """creates bindings on a canvas obj that make attribute go
26 from normal to highlight when the mouse is over the obj""" 26 from normal to highlight when the mouse is over the obj"""
27 canvas.tag_bind(obj,"<Enter>", 27 canvas.tag_bind(obj,"<Enter>",