home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: Counter.h,v 1.1 1997/04/02 18:28:25 croehrig Exp $
- *
- * Counter: simple counter object that runs in its own thread.
- */
-
- #import <objc/Object.h>
- #import "CJRLock.h"
-
- @interface Counter : Object
- {
- // targets
- id countField;
- id intervalField;
- id slider;
- id window;
-
- @private
- char *title;
- int mynum;
- volatile int count;
- volatile int interval;
- volatile BOOL running;
- CJRConditionLock *runlock;
-
- }
-
- // Actions
-
- - start:sender;
- // Starts counting (detaches a new thread to count)
-
- - stop:sender;
- // Stop (pause) the counter (ends the thread)
-
- - startOrStop:sender;
- // Starts or stops the counter depending on the sender's state
- // (sender should be a Button)
-
- - reset:sender;
- // resets the counter to zero
-
- - setInterval:sender;
- // Target for actions that change the count interval
-
- @end
-