
Move a cursor (in a subwindow) using a hook

lperezr
Hi, I am trying to update a value in a SetVariable object whenever I move a cursor in a graph (similar to the Cursor Moved Hook Demo), except that this time the graph is a subwindow in a panel and I cannot find the way to make it work. Do you have any suggestions? Thank you.
Can you provide a minimal working example to show what is not working?
February 21, 2023 at 04:00 am - Permalink
Here is how I place a cursor in a subwindow
Cursor /W=Panel_Fit_Spectra_For_Energies#G0 A Spectrum_1D_Shifted pnt2x(w_Spectrum_1D_Shifted,0)
Good luck!
February 21, 2023 at 04:16 am - Permalink
Note that graph subwindows don't have their own hook functions, you have a set a hook for the parent window to monitor for the cursor moved event. Maybe that is part of the problem?
February 21, 2023 at 04:27 am - Permalink
Here's a modified Cursor Moved Hook example that hooks a subwindow
February 23, 2023 at 11:06 am - Permalink