ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Temp/ThreadedApp-1.1/SimpleCounter.h

This is SimpleCounter.h in view mode; [Download] [Up]

/*
 *  $Id: SimpleCounter.h,v 1.2 1997/04/07 01:13:42 croehrig Exp $
 *
 *  Counter:  simple counter object that runs in its own thread.
 */

#import <objc/Object.h>
#import <misckit/MiscLock.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;
    MiscConditionLock *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

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.