ftp.nice.ch/peanuts/GeneralData/Documents/books/AlexNeXTSTEPSource.tar.gz#/NSProgramming/Chapter7_Views/Shapes/SquareView.m

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

/* Generated by Project Builder */

#import <appkit/appkit.h>
#import "SquareView.h"

@implementation SquareView

-drawSelf: (NXRect *)rects :(int)rectCount
{
	// erase current drawing
	[super erase];
	// translate axes to current offsets
	PStranslate(x, y);
	// rotate axes to current angle
	PSrotate(angle);
	// scale axes to current values
	PSscale(xScale, yScale);
	// draw a square that's 5 by 5 units
	PSmoveto(-5, -5);
	PSrlineto(10, 0);
	PSrlineto(0, 10);
	PSrlineto(-10, 0);
	PSclosepath();
	// set color to white
	PSsetgray(1.0);
	PSfill();
	return self;
}

@end

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