I wrote 2 functions names are BooleanTest
and MainTest
.The following code is below
BooleanTest[enable_, backgroundList_] :=
Table[
(
If[
(SameQ[Part[enable, enableNo], False]),
(Table[RGBColor[0.784, 0.796,0.816], {Length[Part[backgroundList, enableNo]]}]),
(Table[White, {Length[Part[backgroundList, enableNo]]}])
]
),
{enableNo, 1, Length[enable]}
]
(*Second function*)
Options[MainTest] :=
{
backgrounds -> Table[RGBColor[0.784, 0.796, 0.816], {3}, {7}]
};
MainTest[firstNo_, LastNo_, enableList_, OptionsPattern[]] :=
(
Module[
{dummyBackgrounds = OptionValue[backgrounds]},
(
dummyBackgrounds =
Dynamic[(BooleanTest[Setting[enableList],
OptionValue[backgrounds]]),
TrackedSymbols :> {Setting[enableList]}];
Dynamic[
{
Setting[Part[dummyBackgrounds, 1, 1]],
Setting[Part[dummyBackgrounds, 2, 1]],
Setting[Part[dummyBackgrounds, 3, 1]]
}
]
)
]
)
(Notebook Code)
first = 10; last = 20; enables = {False, False, False};
In my actual code,all the arguments of the MainTest
are dynamically change.But here third argument only will change.
The first function returns colors depending upon the False position from the Third argument of the MainTest
.
The first function,I am calling in my second function.But that function evaluates,whenever Third argument will change.
and it returns updated [[1,1]],[[2,1]],[[3,1]]
elements in a list form.
I am calling my second function in the following way.
MainTest[first,last, Dynamic[enables]]
but it's not working,I guess TrackedSymbol
code was wrong.
can anyone help me?
Fell free,If you want to edit my question.
Thank you..
DynamicModule[{dummyBackgrounds = ...
andDynamic[ dummyBackgrounds = BooleanTest[ ...
. – Silvia Apr 23 at 11:13