This is ToolTemplate.m in view mode; [Download] [Up]
#import "XXXX.h"
@implementation XXXX
// If the object has an inspector, we'll load it here. Initialize variables
// that will be displayed by the inspector.
- init
{
NXBundle *bundle;
char path[MAXPATHLEN+1], inspectorName[MAXPATHLEN+1];
[super init];
strcpy(inspectorName, [[self class] name]);
strcat(inspectorName, "Inspector");
bundle = [NXBundle bundleForClass:[self class]];
// If the Inspector nib file exists, load it. Otherwise, free the bundle.
if([bundle getPath:path forResource:inspectorName ofType:"nib"])
[NXApp loadNibFile:path owner:self withNames:NO fromZone:[self zone]];
else
[bundle free];
// Initialize variables that will be used by the inspector.
return self;
}
SETMETHODSM
// Implement methods called by the inspector's ok: method.
// Implement methods called by the inspector's revert method.
// ****************************************************************************
// ****************************************************************************
// WBTool protocol methods.
// ****************************************************************************
// ****************************************************************************
- evaluate:sender
{
return self;
}
// Set up the null terminated list of connectors that the tool will need.
- (char **)requiredConnectors
{
static char *connectors[] = {CONNECTORSTRINGNULL};
return connectors;
}
// Return the inspector.
- inspector
{
return inspector;
}
- setInputText:text
{
inputText = text;
return self;
}
- setOutputText:text
{
outputText = text;
return self;
}
- setOutputViewBox:box
{
outputViewBox = box;
return self;
}
@end
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.