ftp.nice.ch/pub/next/developer/resources/classes/UHInspector.1.2.N.bs.tar.gz#/UHInspector_1.2/InspectorSimpleDemo/SimpleDemo.m

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

#import "SimpleDemo.h"
#import "Clipper.h"
#import "ClipperInspector.h"
#import "Gain.h"
#import "GainInspector.h"
#import "Sine.h"
#import "SineInspector.h"

@implementation SimpleDemo

- init
{
	[super init];
	
	/* Now get the objects to be inspected for this demo. Not all inspectable objects
		must respond to setLabel:, but I know that these do.  Also get their
		inspectors. */
	clipper=[[[Clipper alloc] init] setLabel:"clipper"];
	clipperInspector=[[ClipperInspector alloc] init];
	gain=[[[Gain alloc] init] setLabel:"gain"];
	gainInspector=[[GainInspector alloc] init];
	sine=[[[Sine alloc] init] setLabel:"sine"];
	sineInspector=[[SineInspector alloc] init];
	return self;
}

- doInspect:sender
{	
	switch([sender selectedTag]){
		case 0:		//a clipper instance
			[clipperInspector inspect:clipper requestor:self];
			[clipperInspector showInspector:self];
			break;
		case 1:		//a gain instance
			[gainInspector inspect:gain requestor:self];
			[gainInspector showInspector:self];
			break;
		case 2:		//a sine instance
			[sineInspector inspect:sine requestor:self];
			[sineInspector showInspector:self];
			break;
	}
    return self;
}

/* Message to requestor from inspector (UHInspector subclass) when an object list is inspected. */
- objectWasInspected:object
{
	char buf[40];
	sprintf(buf,"Object inspected has label %s.",[object label]);
	[requestorMsgField setStringValue:buf];
	return self;
}



@end

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