Q: How to read a TitleBox's title
It's just a simple problem,
I couldn't figure out how to read the title for a comparison (stringmatch(anotherString, TitleBox'sTitle)).
The title is not being set by a string variable, which is why ControlInfo + S_Value won't work (I suppose)...
Thanks for helping me out!
Q: How to set a PopUpMenu's item?
Hello Igor Community,
I have another small problem which I wasn't able to solve with the Igor help or the forum.
I have a popUpMenu (4 items, strings) which returns (ControlInfo - V_Value) values 0 to 3 with respect to the selected item. Is it possible to change the selected item by code - in a reversed manner of the (Controlinfo - V_Value) readout? I was only able to change the whole list of selectable items by (popupmenu MENUNAME value = STRINGLIST)...
ControlInfo sets also a global string variable S_recreation which is the command that recreates the named control. The title of the TitleBox control can be found in that string and then extracted. You could use code like
sout= StringFromList(1,ListMatch(S_recreation, "title=*", ","),"\"")
but probably it can be done easier and I am not perfectly sure if the line above is really bug-free ... Of course you should first create a TitleBox named title0 for the above code to work.
Hope this helps!
PopupMenu pop0, mode=1 // select first item in the popup list
PopupMenu pop0, mode=2 // select second item in the popup list
PopupMenu pop0, mode=3 // select third item in the popup list
PopupMenu pop0, mode=4 // select fourth item in the popup list
If you want to change the selection by string , use:
Popupmenu pop0, popmatch="this text must match the third item"
Software Engineer, WaveMetrics, Inc.
Thank you two,
you did help me a lot!
Back to top