Skip to reading
Panels, Tabs & List Boxes

Always handle “nothing selected”

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView illustrations

Figure 19. The chosen ID is empty, and Review clue asks the player to choose a clue first.

A single-select list can have no selection. This happens at startup, when the selected row is clicked again, or when its source row is removed. The Review Button must cope with that.

1. Start with selected_clue empty, rather than pre-filling it with letter.

2. Select the letter, click it again and check that its highlight disappears.

3. Press Review clue with no selection. Show a short instruction rather than trying to look up an empty ID.

4. Select the letter again, then review it. Check that the correct response appears.

Treat Selected Item Variable as an output from the widget. Setting selected_clue to letter with Set Variable does not, by itself, tell the list to highlight that row. A variable and the widget’s internal selection are separate pieces of state.

For a manual list, List Box: Modify Item can change the selected property deliberately. For a live Array or inventory list, read Chapter 21 before doing that: it switches the list to a local copy.

Page 22 of 50Permalink
Go to page