I looked at this a little bit, but I didn’t come up with as clean a solution as @victordcq for this application, but nevertheless, I figured I would go ahead and post what I had developed in case the direction could be of use to somebody.
def runAction(self, event):
#==============================================
# self.props.columns[0].strictWidth = True
# self.props.columns[1].strictWidth = True
# self.props.columns[2].strictWidth = False
#==============================================
self.props.rows.height = 30
mousePositionX = event.pageX-self.position.x
mousePositionY = event.pageY-self.position.y
row = (mousePositionY/self.props.rows.height)-2
if mousePositionX < self.props.columns[0].width:
self.meta.tooltip.text = str(self.props.data[row].city)
elif mousePositionX < (self.props.columns[0].width + self.props.columns[1].width):
self.meta.tooltip.text = str(self.props.data[row].country)
else:
self.meta.tooltip.text = str(self.props.data[row].population)
The preceeding code running on the onMouseMove event script produces the following result:
It uses the mouse position relative to the component’s placement, cell height, and column width to determine what cell the mouse is hovering over