Info-Mac Archive Downloads: dev/src/ SourceCode

Back to dev/src/ SourceCode

/source/c/canimcursor-10b4.hqx (canimcursor-10b4-c.hqx)

Download canimcursor-10b4-c.hqx (34,329 KB)


From: k044477@hobbes.kzoo.edu (Jamie R. McCarthy)
Subject: /source/c/canimcursor-10b4.hqx
Date: Mon, 14 Sep 92 13:56:45 EDT

This Compact Pro archive contains the source code for CAnimCursor,
a public domain Think C 5 class that provides easy, flexible handling
of animated cursors. The Think Class Library is not required. This
is the fourth beta. (It's quite stable and hasn't crashed in months,
but I'm still calling it beta because of a minor anomaly which I
haven't resolved yet.)

CAnimCursor uses an 'acur' resource to determine which cursors to
display; the animation speed and a few other variables are changed
by method calls. Both color and B&W are supported. The interface
can be as simple as initializing the object with the resource ID of
your 'acur', and calling startAnimating() and stopAnimating() at the
appropriate times.

CAnimCursor's best feature is that it is very good about doing the
Right Thing (tm). For example, if your 'acur' points to color
cursors and the Mac is B&W, it will pull the B&W bitmaps out of the
'crsr's. If you call startAnimating() twice, the second call will
have no effect. And so on.

CAnimCursor will not call SetCCursor at interrupt time, since that
trap relies on the heap being good, and will fail if the interrupt
occurs during a memory manager reorganization. This does not happen
often, but one crash is one too many.

Also included are CQixableCursor, a subclass which optionally draws a
little 'Qix' over your cursors; subclasses of three TCL core classes
which will prevent the cursor from being reset each time through the
event loop; a short sample subclass; and four sample cursors,
including a smooth beachball and a color spinning earth. (I stole
the earth from Stefan Bilaniuk's free extension "Earth," also at
sumex-aim. I feel no guilt because I guess he stole it from someone
else ;-), and because I colorized all 26 frames by hand, phew!)

Extensive (indeed, ponderous) comments explain proper usage, and there
are even one or two comments in the code itself. Plus, it comes with
a toll-free technical support number, which I figure is a pretty good
deal for something in the public domain, eh?