ftp.nice.ch/pub/next/developer/objc/appkit/Starter.1.1.s.tar.gz#/Starter1.1/DocumentClass.m

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

#import "DocumentClass.h"
#import "STUtil.h"
#import "STMenuCategory.h"

@implementation DocumentClass

- init
{	
const char *p=getDefaultWithErrorCheck("WindowSize");
int winWidth, winHeight;
	
	[super init];

	/* set the window size according to the default */
	if(p && window)
	 { sscanf(p,"%d %d", &winWidth, &winHeight);
	   [window sizeWindow:(NXCoord)winWidth :(NXCoord)winHeight];
	 }
	return self;
}



/* ==== Edit methods ==== */

- delete:sender
{   
	if(![[NXApp delegate] isDeleteEnabled]) return self;
	if(NXRunAlertPanel("Are you sure to delete ?",
	"This operation is not reversable",
	"Do not delete","Delete All",NULL)==NX_ALERTDEFAULT) return self;

	[window disableFlushWindow];

	/* do deletion here */
	
	[window reenableFlushWindow];
	[window flushWindow];
	[NXApp perform:@selector(updateWindows) with:nil
	   afterDelay:1 cancelPrevious:YES];
	return self;
}

- selectAll:sender
{
	[window disableFlushWindow];

	/* do selection here */
	
	[window reenableFlushWindow];
	[window flushWindow];
	[NXApp perform:@selector(updateWindows) with:nil
	   afterDelay:1 cancelPrevious:YES];
	return self;
}

@end

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