ftp.nice.ch/pub/next/unix/developer/autodoc.1.8.2.s.tar.gz#/v1.8.2/Examples/Source/MyView.m

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

/*
		Copyright (c) MyCorporation, Inc., 1995.
                  All Rights Reserved.

Filename: MyView.m
Author:   me
Date:	  Mar 15, 1995

$Id: MyObject.h,v 1.0 1995/03/15 19:22:00 me Exp $
 $Log: MyObject.h,v $
*/

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

@implementation MyView
	/**" 
	*** MyView is a subclass of View which provides the methods
	*** #setBackgroundColor: and #color to set and query the background color 
	*** for the view.  
	*** 
	*** Note that this is a %{really useless} example class!
 	***
	*** The .001\% of the time you wish to show the \% and \# characters,
	*** (or even as #{bold \%} and %{italics \#}!)
	"**/


/*
 * Determining the color 
 */
- setBackgroundColor:(NXColor)aColor
	/*" Sets the background color of the view to aColor, and returns self. "*/
{
	backgroundColor = aColor;
	return self;
}

- (NXColor)backgroundColor
	/*" Returns the color which is displayed as a background to this view. "*/
{
	return backgroundColor;
}

/*
 * Displaying 
 */
- drawSelf:(const NXRect *)rects :(int)rectCount
	/*" 
	 * Fills the rectangles specified by rects and rectCount with the 
	 * background color specified with #setBackgroundColor: and then 
	 * returns self. 
	"*/
{
	NXSetColor (backgroundColor);
	if (rectCount == 3) {
		NXRectFill (&rects[1]);
		NXRectFill (&rects[2]);		
	} else {
		NXRectFill (&rects[0]);
	}
	return self;
}

@end

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