Suppose there are several points on my canvas, each corresponds to a data of the form [point index, point's x coordanate, point's y coordinate], all these points are <br>created by the following sentence,<br><br>for point in self.data: <br>
#self.data is a point list and has the form [point1, point2, ...]<br> self.drawing.create_oval(point[1]-2, point[2]-2, point[1]+2, point[2]+2,fill='black',tags='Toselect')<br>
#self.drawing is a Canvas <br> self.drawing.tag_bind('Toselect', '<Any-Enter>', self.mouseEnter)<br><br>and the following is the self.mouseEnter function:<br><br>def mouseEnter(self,event):<br> self.CoordinateShow.configure(text='point:'+str(event.x)+','+str(event.y))<br>
#self.CoordinateShow is a Label to show the point's information<br><br>I want to show the related information of the point when my mouse moves upon them...<br>The KEY problem is: How can the mouse read out that point's OWN information, such as the point's index, x and y coordinate, and even the point's color. You see, the mouse's function here accually works on its own x and y coordinates(event.x and event.y), not the point's value.<br>
(now the self.mouseEnter function don't manipulate color, but my future work will have to handle this...)<br><br>Thanks Very Much!<br><br><br>