#import <appkit/appkit.h>

BOOL getOpenFilenameAndPath(char *filename, char *path, const char *fileType)
{	static id openPanel = nil;

	if (!openPanel) openPanel = [OpenPanel new];
	[NXApp setAutoupdate:NO];
	if ([[openPanel chooseDirectories:YES] runModalForDirectory:path file:filename]) {
		strcpy(filename,*[openPanel filenames]);
		strcpy(path,[openPanel directory]);
		[NXApp setAutoupdate:YES];
		return YES;
	} else {
		[NXApp setAutoupdate:YES];
		return NO;
	}
}
