Listboxes in Igor Pro
A listbox is backed by waves: one for the text, one for the selection.
Function AddList()
Make/O/T/N=0 root:Settings:listText
Make/O/N=0 root:Settings:listSel
WAVE/T listText = root:Settings:listText
WAVE listSel = root:Settings:listSel
String names = WaveList("*", ";", "")
Variable n = ItemsInList(names)
Redimension/N=(n) listText, listSel
listText = StringFromList(p, names)
ListBox waveList, pos={16, 210}, size={280, 90}, mode=4
ListBox waveList, listWave=listText, selWave=listSel
End
How it works
listWave=holds the rows;selWave=holds the per-row state.mode=decides single, multiple or checkbox selection.- Changing the wave changes the list; there is nothing else to refresh.
Keywords and builtins used here
EndFunctionItemsInListListBoxMakeRedimensionStringStringFromListVariableWAVEWaveListwaveList
The run, in numbers
- Lines
- 14
- Characters to type
- 422
- Tokens
- 110
- Three-star pace
- 85 tpm
At the three-star pace of 85 tokens a minute, this run takes about 78 seconds.
Step 1 of 4 in Bigger controls, step 9 of 18 in Panels & GUI.