Thanks to Bill Lam for the way to manage the timeing.  Maybe this version 
will help you.  It was what I wanted.  Thanks.  Linda

require 'bmp gl2'

STUDY=: 0 : 0
pc study;
xywh 0 0 32 30;cc P1 button;cn "1";
xywh 33 0 32 30;cc P2 button;cn "2";
xywh 66 0 32 30;cc P3 button;cn "3";
xywh 0 33 300 300;cc g isigraph;
pas 0 0;
rem form end;
)

study_run=: 3 : 0
imgfn=: '' [ aa=:tick=: 0
wd STUDY
wd 'pshow;ptop;'
wd 'timer 50' [ bb=:tick=: 0 [ button=: 1
paint '~system\examples\data\toucan.bmp'
)

study_close=: 3 : 0
wd 'timer 0;pclose'
)

study_P1_button=: 3 :0
wd 'timer 1' [ cc=:tick=: 0 [ button=: 2
NB.wd 'winexec "c:\jsoftware\j602\lla\mplayer2.exe 
c:\jsoftware\j602\lla\00will.wav";'
)

study_P2_button=: 3 : 0
wd 'timer 50' [ dd=:tick=: 0 [ button=: 3
paint '~system\examples\data\jbox.bmp'
NB.wd 'winexec "c:\jsoftware\j602\lla\mplayer2.exe 
c:\jsoftware\j602\lla\01will.wav";'
)

study_P3_button=: 3 : 0
NB.wd 'timer 50' [ tick=: 0 [ button=: 1
paint '~system\examples\data\j.bmp'
NB.wd 'winexec "c:\jsoftware\j602\lla\mplayer2.exe 
c:\jsoftware\j602\lla\00will.wav";'
)

paint=: 3 : 0
glclear_jgl2_ ''
dat=. 256 #. 256 256 256 #: readbmp jpath y
glpixels_jgl2_ (0 33,|.$dat),,dat
glpaint_jgl2_ ''
)

sys_timer=: 3 : 0
if. interval <: tick=: >:tick do.
   wd 'timer 0'
   tick=: 0
   select. button
   case. 1 do. study_P1_button '' [ wd 'setfocus P1'
   case. 2 do. study_P2_button '' [ wd 'setfocus P2'
   case. 3 do. study_P3_button '' [ wd 'setfocus P3'
   end.
end.
)

interval=: 100  NB. interval in 0.1s
study_run ''



**************
Start the year off right.  Easy ways to stay in shape.
     
http://body.aol.com/fitness/winter-exercise?NCID=aolcmp00300000002489
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to