3
$\begingroup$

How can I select elements of a list of strings {"a", "b", "c"} using Manipulate, such that when a checkbox is unchecked, only the other elements are presented?

    Manipulate[ 
     {"a", "b", "c"}, 
     Control[{"a", {True, False}}],
     Control[{"b", {True, False}}],
     Control[{"c", {True, False}}]
    ]
$\endgroup$
5
$\begingroup$

Using a custom function to specify a CheckboxBar in the Manipulate, you can do the following:

list = {"a", "b", "c"};
Manipulate[selected, {{selected, {}}, CheckboxBar[#, list] &}]

You can still change the initial value like with other control specifications by replacing the {} with {"a"} or list or such.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.