typestar

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

  1. listWave= holds the rows; selWave= holds the per-row state.
  2. mode= decides single, multiple or checkbox selection.
  3. Changing the wave changes the list; there is nothing else to refresh.

Keywords and builtins used here

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.

Type this snippet

Step 1 of 4 in Bigger controls, step 9 of 18 in Panels & GUI.

← Previous Next →