ftp.nice.ch/pub/next/tools/frontends/CommandMon.1.00.s.tar.gz#/CommandMon/Indicator.m

This is Indicator.m in view mode; [Download] [Up]

#import "Indicator.h"
#import <dpsclient/wraps.h>
#import <appkit/Application.h>

@implementation Indicator

- initFrame:(NXRect *)frameRect
{
	[super initFrame:frameRect];
	on=NO;
	return self;
}

- drawSelf:(NXRect *)rects :(int)count
{
	if (on)
		PSsetrgbcolor(1,0,0);
	else
		PSsetgray(NX_WHITE);
	NXRectFill(&bounds);
	PSsetgray(NX_BLACK);
	NXFrameRect(&bounds);
	return self;
}
		
- flash
{
	void endLight ();
	on=YES;
	[self display];
    if (timer) DPSRemoveTimedEntry(timer);
    timer=DPSAddTimedEntry(.2,&endLight,self,NX_BASETHRESHOLD);
	return self;
}

- turnOff
{
	on=NO;
	[self display];
	return self;
}

void endLight (DPSTimedEntry timedEntry, double timeNow, void *data)
{
	[(id)data turnOff];
}


@end

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