psychopy/psychopy — comment on commit 76baee27581ac3a6ab46d9e773b312eb5591ed18
File:  line 0
By maebert:

I played with a few different use cases, and this approach seemed the more flexible, since it allows you to separate display and data:

```python
conditions = [1, 5, 10]
labels = ['Low', 'Medium', 'High']
dlg.addField('Cognitive Load', choices=labels)
# ...
cog_load = condition[dlg_data[0]]
```

of course, using `GetStringSelection` this would still be possible with a `dict`:

```python
conditions = {'Low': 1, 'Medium': 5, 'High': 10}
dlg.addField('Cognitive Load', choices=conditions.keys())
# ...
cog_load = condition[dlg_data[0]]
```

I merely found that I have values to choose from more likely stored in a list than in a dict. But maybe we should allow for three variants:

1. Just specify `choices` as a tuple or list, which will return the choice as displayed (ie. as `GetStringSelection`)
2. Specify an optional `choice_labels`, which will be displayed, but the value returned will still be the corresponding element of `choices`
3. Allow `choices` to be a `dict`, in which case the keys will be displayed and the corresponding value returned.

That will require a little more meddling with the `Dlg` class to remember which behaviour to apply, but if you agree I can implement it like this. Or maybe, add another method `addDropDown` instead of extending the `addField` method?