3
$\begingroup$

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?

$\endgroup$
5
$\begingroup$

Simon's code

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]

Mathematica graphics

$\endgroup$
  • $\begingroup$ Wow, this looks cool. I wonder how the speed of evolution gets set since no Pause[] is used? $\endgroup$ – Kagaratsch Aug 21 '15 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$ – Dr. belisarius Aug 21 '15 at 3:22
  • $\begingroup$ Or post a question about that :D $\endgroup$ – Dr. belisarius Aug 21 '15 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$ – Kagaratsch Aug 21 '15 at 3:25
  • 1
    $\begingroup$ @Kagaratsch Changing your question scope after you receive answers is a bad practice, I think $\endgroup$ – Dr. belisarius Aug 21 '15 at 3:28

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.