[comp.sys.mac.programmer] Looking for a thermometer

jtn@potomac.ads.com (John T. Nelson) (06/26/91)

Yes it's ME again!  I'm looking for source code (compatible with
Lightspeed C preferabley) that will display a "progress indicator" or
"thermometer" as they are sometimes called.  You know... like the
progress indicator you get when copying files.  Well how to do it?

And please... no useless zebra striped guages :-)

jtn@potomac.ads.com (John T. Nelson) (06/26/91)

In article <1991Jun25.185302.5653@potomac.ads.com> jtn@potomac.ads.com (John T. Nelson) writes:
>
>Yes it's ME again!  I'm looking for source code (compatible with
>Lightspeed C preferabley) that will display a "progress indicator" or
>"thermometer" as they are sometimes called.  You know... like the
>progress indicator you get when copying files.  Well how to do it?
>
>And please... no useless zebra striped guages :-)

And now I'm going to respond to my own posting.  The thermometer
problem is TRIVIAL with a capital T.  Basically all you need to do is
define a Rect someplace (like in a resource), get the size of the rect
and modify rect.right as follows:

rect.right = rect.right * count / totalCount;

As count counts towards totalCount it sets the right side of the rect
to be larger and larger.  Then you just do PaintRect(&rect).  Don't
forget to do PenPat(gray) before doing the PaintRect.

Its a quick half-hour hack.


---
John T. Nelson			Internet: jtn@potomac.ads.com
Advanced Decision Systems	Uucp: kzin!speaker@mimsy.umd.edu
Arlington, VA (703) 243-1611