
/* Generated by Interface Builder */

#import "ToWebster.h"
#import <sys/port.h>
#import <appkit/Control.h>
#import <appkit/Speaker.h>
#import <appkit/Listener.h>
#import <appkit/Panel.h>
#import <appkit/Application.h>

@implementation ToWebster


- define: sender {
	int	speakerResult;
	int	websterResult;
	port_t    websterPort;

	// [[sender window] orderOut:self];
	websterPort = NXPortFromName("Webster", NULL);
	
	if (websterPort == PORT_NULL)  {
		NXRunAlertPanel("Define...", "Port was not found, %s.\n", "OK", 0, 0, NXUserName());
		return self;
	}
	
	[[NXApp appSpeaker] setSendPort: websterPort];
	
	speakerResult = [[NXApp appSpeaker] openFile: [sender stringValue] ok: &websterResult];
	
	if (speakerResult != 0) {
		NXRunAlertPanel("Define...", "Message failed, %s.\n", "OK", 0, 0, NXUserName());
	}
	return self;
}

@end
