This set of files implements a small window that has a progress bar. The progress bar can be determinate or indeterminate, and is Appearance Manager-savvy. It has a variable "greediness" to control how often it calls WaitNextEvent. The caller can vary how frequently the thermometer will be incremented. There is a text item to display a string, which can be changed during the run. For the determinate case, the progress box calculates an estimated time to completion. There is a "pause" button which allows the user to suspend program function, aside from other threads and periodical tasks. Version 1.1 adds an "auto-greediness" option, in which it calls WaitNextEvent more frequently (or even suspends the code in which it lives) when it senses user action, and takes more CPU time when the mouse hasn't been moved for a specified amount of time. An example App is included.

Source Code

 

-Dave Hirsch