ftp.nice.ch/pub/next/developer/resources/classes/misckit/MiscKit.1.10.0.s.gnutar.gz#/MiscKit/Examples/TreeView/TreeButtonCell.m

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

//		Written by Don Yacktman Copyright (c) 1994 by Don Yacktman.
//				Version 1.0.  All rights reserved.
//
//		This notice may not be removed from this source code.
//
//	This program is included in the MiscKit by permission from the author
//	and its use is governed by the MiscKit license, found in the file
//	"LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
//	for a list of all applicable permissions and restrictions.
//	


#import "TreeButtonCell.h"
#import "TreeButton.h"

@implementation TreeButtonCell

- parent { return parent; }
- setParent:anObject
{	// anObject should be the parent Control object subclass
	parent = anObject;
	return self;
}

- (BOOL)trackMouse:(NXEvent *)theEvent
		inRect:(const NXRect *)cellFrame ofView:aView
{	// this traps the button being selected.
	BOOL result = [super trackMouse:theEvent inRect:cellFrame ofView:aView];
	if (result && [parent respondsTo:@selector(wasSelected:)]) {
		[parent wasSelected:self];
	}
	return result;
}

- performClick:sender
{
	[super performClick:sender];
	if ([parent respondsTo:@selector(wasSelected:)]) {
		[parent wasSelected:self];
	}
	return self;
}

@end

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