I am trying to build an UI for my algorithm, to handle some input parameters. Under that scope I am building a checkbox menu.
What I need to do is nest some checkboxes under some parent checkbox, so that when I click "Test", all checkboxes nested bellow can be automatically checked, but then I want to have the ability to unlclick some of them (or parent) individually.
So, if I call them:
Test
-Subtest 1
-Subtest 2
I want to be able to check Test1 and have subtest 1 and subtest 2 checked, but to be able to override them, and unclick one of them, or even unclick Test and keep subtest1 and subtest2 clicked.
Keep in mind that test, subtest1 and suntest2 are referring to 3 individual objects, and test1 is not just a group shortcut.
I wrote this (it does not work)
{"Test 1",Checkbox[Dynamic[yesNoTest]]}
{"--Sub Test 1",
If[TrueQ[Dynamic[yesNoTest]],Checkbox[Dynamic[yesNoTestSub1]],
Checkbox[Dynamic[yesNoTestSub1]]
]}
{"--Sub Test 2",
If[TrueQ[Dynamic[yesNoTest]],Checkbox[Dynamic[yesNoTestSub1]],
Checkbox[Dynamic[yesNoTestSub2]]
]}
I do not know how to set a checkbox being "clicked" by default. My basic idea was to test weather yesNoTest
is True, and if so return
Checkbox[Dynamic[yesNoTestSub1]]
== True, else return it without knowing weather T or F and waiting for user to give input (as it is already)