3

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?

Kagaratsch
  • 11,955
  • 4
  • 25
  • 72

1 Answers1

5

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

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453