Skip to content

Selection list

Preview

textual_wizard.inputs.SelectionList

SelectionList(
    name: str,
    label: str,
    *,
    options: list[tuple[str, FieldValueType, bool]]
)

Bases: InputType, Generic[FieldValueType]

Allows the user to select multiple options within a predifined list, similar to a checklist.

PARAMETER DESCRIPTION
name

The input identifier, used as key in the returned answers dict.

TYPE: str

label

The title of the input, displayed to the user.

TYPE: str

options

A list of options that can be selected by the user. An option is represented by the tuple (display string, value, selected by default?)

TYPE: list[tuple[str, FieldValueType, bool]]

label instance-attribute

label: str = label

name instance-attribute

name: str = name

options instance-attribute

options: list[tuple[str, FieldValueType, bool]] = options

wid instance-attribute

wid: SelectionList[FieldValueType]

inq_ask

inq_ask() -> FieldValueType