2

Consider some list:

list = {"A","B","C","D"}

How to select only particular values from it using a dynamic dialog window that prevents the code below it from evaluating before the choice is made (by using e.g. DialogInput)?

John Taylor
  • 5,701
  • 2
  • 12
  • 33

1 Answers1

5

You can use TogglerBar.

selectionDialog[list_] := 
 DialogInput[{choice = {}}, 
  Column[{TogglerBar[Dynamic[choice], list], 
    Button["OK", DialogReturn[choice]]}]]

list = {"A", "B", "C", "D"}; selectionDialog[list]

Domen
  • 23,608
  • 1
  • 27
  • 45