mirror of
https://github.com/wassname/baukit.git
synced 2026-06-27 14:44:04 +08:00
Use event location property.
This commit is contained in:
@@ -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]])"
|
||||
|
||||
Reference in New Issue
Block a user