def UpdatePointLabel(self, mDataDict):
"""Updates the pointLabel point on screen with data contained in
mDataDict.
mDataDict will be passed to your function set by
SetPointLabelFunc. It can contain anything you
want to display on the screen at the scaledXY point
you specify.
This function can be called from parent window with onClick,
onMotion events etc.
"""
if self.last_PointLabel != None:
# compare pointXY
if np.sometrue(mDataDict["pointXY"] != self.last_PointLabel["pointXY"]):
# closest changed
self._drawPointLabel(self.last_PointLabel) # erase old
self._drawPointLabel(mDataDict) # plot new
else:
# just plot new with no erase
self._drawPointLabel(mDataDict) # plot new
# save for next erase
self.last_PointLabel = mDataDict
# event handlers **********************************
评论列表
文章目录