Function to check whether a panel of given name exists?
PeterR
I wondered whether there is a function or other possibility to check whether a panel of a given name is already open? So that I can close it before opening another instance of it (which almost always causes confusion and mayhem in IGOR).
Any ideas?
Best regards,
Peter
if (WinType("myPanel") == 7)
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
December 2, 2014 at 01:31 pm - Permalink
December 2, 2014 at 01:46 pm - Permalink
Function kill_panel(panelName)
String panelName
// if there is a panel of this name open...
if (WinType(panelName) == 7)
// ... kill it
String path = panelName
KillWindow $path
return 0
else
return -1
endif
End
December 2, 2014 at 02:06 pm - Permalink
I tend to use code like this:
if( V_Flag == 0 ) // panel doesn't exist
NewPanel/N=myPanel // create it.
... etc ...
endif
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
December 2, 2014 at 04:29 pm - Permalink