Use event location property.

This commit is contained in:
David Bau
2022-07-22 20:37:23 -04:00
parent ccc9c56a95
commit c9d65cde33
+1 -1
View File
@@ -511,7 +511,7 @@
"from baukit import Textbox\n",
"coord_b = Textbox()\n",
"def handle_click(e):\n",
" loc = e.target.event_location(e)\n",
" loc = e.location\n",
" coord_b.value = f'x,y=({loc.x:.2f}, {loc.y:.2f}) inside={loc.inside}'\n",
"pw.on('click', handle_click)\n",
"show(show.TIGHT, [['Click the previous plot to see coordinates here:', coord_b]])"