news
About Elegant Chaos
info
About me and my friends
people
Software from Elegant Chaos
software
Other stuff...
stuff

UL_StartProgress

Revision 1
Revised on 19/03/95 18:22

Description

Create a progress window (a progress window is a dialog window like the one the finder uses to display the progress of a file copy). Takes the main message to display in the window (for example "Copying files..."), and the expected number of steps that the action will take.

Once you've created the progress window, you can call UL_AdvanceProgress each time you want to advance the progress indicator by one step.

When you have finished, calling UL_FinishProgress will dismiss the window.

Note that these routines require the Progress XCMD.


Code

on UL_StartProgress message,total
  global gUL_ProgressCount, gUL_ProgressTotal
  
  -- try to create the progress window
  Progress create, message
  
  -- setup the counters
  put 0 into gUL_ProgressCount
  put total into gUL_ProgressTotal
  
  -- if the window got created ok, show it
  if there is a window "Progress" then
    show window "Progress"
  end if
end UL_StartProgress