ftp.nice.ch/Attic/openStep/developer/resources/MiscKit.2.0.5.s.gnutar.gz#/MiscKit2/Tests/TestMMA/AppController.m

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


#import "MiscMMAProcessor.h"
#import "MiscMMAView.h"

#import "AppController.h"

@implementation AppController

- init
{
	[super init];
	mmaProcessor = [[MiscMMAProcessor alloc] init];
	return self;
}

- (void)dealloc
{
	[mmaProcessor release];
	return [super dealloc];
}

- (void)evaluate:(id)sender
{
	NSString *expr = [expressionTextfield stringValue];
	NSDictionary *result;
	id resultComponent;

	if(!expr){
		NSBeep();
		return;
	}

	[mmaProcessor enterExpression:expr];
	result = [mmaProcessor readReturn];
	
	resultComponent = [result objectForKey:@"Error"];
	if(resultComponent){
		[statusTextfield setStringValue:resultComponent];
		return;
	}

	resultComponent = [result objectForKey:@"Syntax"];
	if(resultComponent){
		[statusTextfield setStringValue:resultComponent];
		return;
	}

	resultComponent = [result objectForKey:@"Plot"];
	if(resultComponent)
        	[mmaView setPostScriptData:resultComponent];

	resultComponent = [result objectForKey:@"Text"];
	if(resultComponent)                
		[resultTextView setString:resultComponent];

	[statusTextfield setStringValue:@""];
}
	

@end

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