How should I construct a code which opens a pop up window, displays a constantly updating image in it and is terminated once the pop up is closed? The constant updating would be an infinite loop of predefined functionality. Is this possible in Mathematica?
1 Answer
$\begingroup$
$\endgroup$
6
CreateDialog[
{(a = RandomInteger[BernoulliDistribution[0.1], {200, 200}];
Dynamic[ Image[a = 1 - Unitize[(# - 3) (# - 12) (# - 13)] &@
ListConvolve[{{1, 1, 1}, {1, 10, 1}, {1, 1, 1}}, a, {2, 2}, 0]]]),
DefaultButton[]}, Modal -> True]
-
$\begingroup$ Wow, this looks cool. I wonder how the speed of evolution gets set since no
Pause[]
is used? $\endgroup$ Commented Aug 21, 2015 at 3:20 -
$\begingroup$ @Kagaratsch I believe the actual display and the calculation are decoupled. In any case you may try to see how many FPS your system is capable of :D $\endgroup$ Commented Aug 21, 2015 at 3:22
-
$\begingroup$ Or post a question about that :D $\endgroup$ Commented Aug 21, 2015 at 3:23
-
$\begingroup$ Ok, let me edit the above question in order to specifically ask for a dynamic pop up involving the
Pause[]
command. $\endgroup$ Commented Aug 21, 2015 at 3:25 -
1$\begingroup$ @Kagaratsch Changing your question scope after you receive answers is a bad practice, I think $\endgroup$ Commented Aug 21, 2015 at 3:28