/*
		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
