Here is a progressbar class I use:
NB. Progressbar
NB. Example:
NB.    a=:'Title' conew 'pASepProgressBar'
NB.    proge_run__a ''
NB.    'info' set__a 20
NB.    close__a ''
NB.    destroy__a ''


coclass 'pASepProgressBar'

NB. =========================================================
NB.*create v takes caption for the form
create=: 3 : 0
out=: 0$' '
caption=: y
cancelpressed=: 0
)

NB. =========================================================
NB.*destroy v codestroy
destroy=: codestroy

NB. =========================================================
NB.*PROGE n pc proge form definition
PROGE=: 0 : 0
pc proge;
xywh 6 16 172 11;cc ccprogress progress ws_border;
xywh 6 3 173 10;cc info static;cn "";
pas 6 6;pcenter;
rem form end;
)

NB. =========================================================
NB.*run v run form
run=: 3 : 0
wd PROGE
wd 'pn *',caption
NB. initialize form here
wd 'ptop 1'
seticon ''
wd 'pshow;'
)

close=: 3 : 0
wd'pclose'
)

NB. =========================================================
NB.*set v set pbar
set=: 4 : 0
wd 'set info *',x
wd 'set ccprogress ',":y
)

NB. =========================================================
NB.*close v set pbar
close=: 3 : 0
wd 'pclose;'
)




At 18:28 11.10.2009, you wrote:
>Is there a library of "widgets" or does anybody have any code that can
>display some kind of progress bar.
>E.g.
>
>init_progressBar_ 10 NB. there will be 10 steps to 100% completion
>
>for_i i.10 do.
>   NB. do calculation step here...
>   update_progressBar_ i NB. alter progress bar to position i
>end.
>
>end_progressBar_ '' NB. stop displaying the progress bar.
>
>Just thought I would ask if this already exists before trying to write
>something to do it.
>----------------------------------------------------------------------
>For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to