Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: pause button for Dynamic?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113756] Re: pause button for Dynamic?
  • From: Peter Breitfeld <phbrf at t-online.de>
  • Date: Wed, 10 Nov 2010 06:30:45 -0500 (EST)
  • References: <ibb2aj$59k$1@smc.vnet.net>

Gianluca Gorni wrote:

You can wrap a Manipulate around it:

Manipulate[
 DynamicModule[{brown = {0, 0}},
  If[run,
   Framed@
    Graphics[
     Dynamic[Point[
       brown += RandomReal[NormalDistribution[0, 1/300], 2]]], 
     PlotRange -> 1, ImageSize -> 300],
   Framed@Graphics[{Text["Stopped", {0, 0}]}, ImageSize -> 300]]],
 {{run, True, "Run"}, {True, False}}
 ]
 
> Hello,
>
> I have a simple simulation of a Brownian motion
>
> DynamicModule[{brown = {0, 0}},
>  Framed@Graphics[
>    Dynamic[Point[
>      brown += RandomReal[NormalDistribution[0, 1/300], 2]]], 
>    PlotRange -> 1]]
>
> How can I add a pause/play button?
>
> At the moment the only way I know to stop the animation
> is to delete the output cell.
>
> Thank you in advance,
> Gianluca Gorni
>
>
>

-- 
_________________________________________________________________
Peter Breitfeld, Bad Saulgau, Germany -- http://www.pBreitfeld.de


  • Prev by Date: Re: Default Value for SetterBar
  • Next by Date: Re: Default Value for SetterBar
  • Previous by thread: pause button for Dynamic?
  • Next by thread: Re: pause button for Dynamic?