Control Panel Displays of (Global) Values in Igor 7
jjweimer
First, as best I can tell, the actions of controls on a panel can be divided this way ...
* SetVariable can show and change global numbers dynamically. It can also be used just to show global numbers (dynamically) with limits={..,..,0} and noEdit=1. In this way, SetVariable functions as a ValDisplay, only "better" (no need to reset the control on the panel when the number changes). The downside is, it does not do strings.
* ValDisplay can show numbers or strings. To show a global number or string, the path to that global has to be hard-coded in the definition when the control is first put on the panel (or coded via value = #"..." that cannot however contain string functions e.g. value = #"sname" where sname = "wave[1]"). To re-show a number or string when it changes, the ValDisplay control has to be reset on the panel any time the number or string changes. In this sense, its only advantage over SetVariable is that ValDisplay can show text strings.
* ListBox can show global string wave content dynamically. Number waves have to be converted to string waves to be shown in the ListBox. In this sense, ListBox has an advantage over ValDisplay for strings (no need to reset the control on the panel when the string wave updates) and a disadvantage over SetVariable for numbers (they have to be converted to a string wave).
My questions for Igor 7 are ...
* Will ValDisplay controls be able to access globals dynamically (without the need to reset them manually ... i.e. via ValDisplay ... value=wave[ic])?
* Will ListBox controls be able to include columns of numeric wave values (without the need to convert them to strings)?
In Igor-ese a "variable" can be a "numeric variable" or a "string variable":
•newpanel
•SetVariable setvar0 value=str
ValDisplay's purpose is really to display a numeric value, not a string. That it can display a string value is a useful accident of the fact that the numeric value is formatted using (effectively) sprintf. And that's why you need to manually update the ValDisplay if you use a global string as the format string, whereas the control is automatically updated when the global expression changes.
--Jim Prouty
Software Engineer, WaveMetrics, Inc.
March 24, 2013 at 03:16 pm - Permalink
Thanks for the correction and clarifications.
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAHuntsville
March 25, 2013 at 09:36 am - Permalink