Panel: list

Syntax

{<name>:} list {<strings>}

Description

List sub-panel. A list of text options from which one or more may be selected. The list is made scrollable when necessary.

Membership

Parameters

Switches

Callbacks

Called when an option is selected with a single click of mouse button 1.

<panel>.drag(<window>,<panel>)
panel.drag {
    args w=window, p=panel
}

Called when an option is selected with a double click of mouse button 1.

<panel>.exec(<window>,<panel>)
panel.exec {
    args w=window, p=panel
}

Notes

For multiple selection list boxes, a combination of mouse button and Control key will toggle the selection of an option. A combination of mouse button and Shift key will select a range of options and deselect all others. A mouse button with no keys will just select an option and deselect all others.

Search facilities are available by typing unique sequences corresponding to the beginning of an option label, e.g. "zeb" will select the first option found beginning "zeb". The <Escape> key will reset the search sequence.

Examples

Create a panel window containing an empty list of 10 rows with a white background.

window w = wpanel {
    lst: list -r=10,-bc=white
}

Create a panel window containing a list with several options and an initial value.

window w = wpanel {
   lst: list <'Roads','Drainage','Services'>,-r=4,-d=2
}

Create a panel window containing a multiple selection list. The list is filled after creation.

window w = wpanel {
    lst: list -w=150,-bc=white,-tc=blue,-r=10,-mul
}
# Get all .dat files into the list
dir *.dat,-os=w.lst.label