SubWindowList
Posted February 28th, 2009 by harneit
This might be interesting for you if you are programming Igor Pro user interfaces.
If you have ever tried to make your functions aware of subwindows, you might have missed a function that returns a list of all child windows of a (sub)window with full host specs. The built-in function ChildWindowList only returns "immediate subwindow window names", and does not include the full "host spec path".
print SubWindowList("graph0") prints something like graph0;graph0#G0;graph0#P0;graph0#P0#G0;graph0#P1
whereas print ChildWindowList("graph0") would print G0;P0;P1;
// return a (recursive) list of all child windows with full host specs function/S SubWindowList(hostNameStr) string hostNameStr string childList = ChildWindowList(hostNameStr), swList = hostNameStr + ";" variable n for( n = 0; n < ItemsInList(childList); n += 1 ) swList += SubWindowList(hostNameStr+"#"+StringFromList(n, childList)) + ";" endfor return RemoveEnding(swList) // necessary to avoid empty items end
