Bill,

Do you understand that I don't think this timing issue will fix the
problem I was having with losing the keystrokes in the graphics
window?

Even so, it may later be good to control the simulation speed in my
real app, so I am interested in your suggestion here. I don't think
your solution will be attractive in my app because you have put the
action I want the user to specify into the definition of sys_timer,
not into my try or your try1.

By suggesting your solution in this message, are you implying that my
outline (below, again, with added info) will not slow longer
simulations? By "longer" I mean over 0.5 seconds.


delay=: 6!:3
DELAY=: 0.2

NB. in paint ''
NB. this is the top of paint
NB. wd'timer 500'
NB. ....
NB. this is the bottom of paint
NB. wd'timer 0'
sys_timer_z_=: monad define
delay DELAY
)

On Mon, Sep 21, 2009 at 11:38 AM, bill lam <[email protected]> wrote:
> Brian,
>
> If you want an animation of 0.5 second of the demo you shown in the
> start of this thread, you could do something like this.
>
> sys_timer_z_=: 3 : 0
> if. 0>ntry__=: <:ntry__ do. wd 'timer 0 ' return. end.
> GS_CLEARCOLOR=: pick...@? 144  NB. choose new color
> wd'psel opengl;setinvalid g'   NB. let a paint event happen
> )
>
> try1 =: 3 : 0
> ntry__=: y
> wd 'timer 500'   NB. timer ring each 0.5 sec
> )
>
> then  try1 10 or try1 100
> if you want a faster animation, change the 500 inside wd 'timer 500'
> to a smaller value,
>
> --
> regards,
>

-- 
(B=)
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to