Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
ListChooser
Last updated at 8:04 pm UTC on 9 March 2018
I am a simple dialog to allow the user to pick from a list of strings or symbols.
I support keyboard and mouse navigation, and interactive filtering of the displayed items.

You can specify whether you want the index, or the value of the selected item. If you're interested in the value, you can also allow users to Add a new value not in the list.

cmd-s or <enter> or double-click answers the currently selected item's value/index;
cmd-l or <escape> or closing the window answers nil/zero.

The dialog is implemented using ToolBuilder.

The code which builds the ListChooser dialog: ListChooser buildWith: builder.

Example
 ListChooser chooseItemFrom: #(red green blue yellow black white) title: 'Pick a color'

More examples on the class side.

ListChooser_Pick_a_color_2018.png