MathGroup Archive 2010

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

Search the Archive

ProgressIndicator inside DynamicModule


Dear Group,

dealing with dynamic functions is very frustrating: every now and then
a problem appears, which is totally against my previous experience and
knowledge, and I am simply not able to resolve it. Here is a new one,
any help would be welcome.

Why does ProgressIndicator won't work inside DynamicModule, where
1. it works without enclosing the Grid in DynamicModule,
2. the 'sw' switch is correctly displayed (but not 'pr').
??

DynamicModule[
 {pr = 0, range = {0, 100}, sw = False},
 Grid@{{
    Button["Push me",
     (sw = True;
      Do[pr = i; Pause[.02];, {i, range[[1]], range[[2]]}];
      sw = False;), Method -> "Queued"],
    Dynamic@ProgressIndicator[Dynamic@pr, range],
    Dynamic@pr,
    Dynamic@Switch[sw, True, "Calculating...", False, "Finished.", _,
"Standing by."]
    }}
 ]


Thanks in advance
Istvan


  • Prev by Date: Re: Select list elements and exchange them
  • Next by Date: Re: Select list elements and exchange them
  • Previous by thread: Re: an attempt at solid modeling with Mathematica
  • Next by thread: Re: ProgressIndicator inside DynamicModule