How to operate not on top window,but on top graph?

Hello,

Short version: Is there a way to operate not on the top window, but specifically on the top graph?

Long version: I'm currently writing a set of functions and a GUI for analysis of electrophysiology data (the GUI is based on the Wave Selector Example Widget). One of the functions is a simple peak analysis, which calculates the peak amplitude, the 10-90% rise time, and does an exponential fit of the peak decay. For optical control, the user can choose to display horizontal lines that indicate the baseline and peak level, and vertical lines that indicate the x-positions of the 10 and 90% peak level. These lines are drawn on the UserFront layer. I would now like to add a button that erases that layer in the last graph that was on top. So I need to find away to apply the SetDrawLayer/K UserFront command to that graph, without affecting my GUI (which becomes the top window when the button is clicked). The DoWindow/F command requires the window name, which of course varies and would require additional user input. So, to repeat the short version above: Is there a way to operate not on the top window, but specifically on the top graph?


Thanks in advance,

Jan
jterhag wrote:

Short version: Is there a way to operate not on the top window, but specifically on the top graph?


Take a look at the function WinName. This can be used to return the name of the top graph window, but see the details of its use.