comparison pkg-src/tree-nx/TreeButtonCell.m @ 163:0132846995bd r20-3b8

Import from CVS: tag r20-3b8
author cvs
date Mon, 13 Aug 2007 09:43:35 +0200
parents
children
comparison
equal deleted inserted replaced
162:4de2936b4e77 163:0132846995bd
1
2 #import "TreeButtonCell.h"
3 #import "TreeButton.h"
4
5 @implementation TreeButtonCell
6
7 - parent { return parent; }
8 - setParent:anObject
9 { // anObject should be the parent Control object subclass
10 parent = anObject;
11 return self;
12 }
13
14 - (BOOL)trackMouse:(NXEvent *)theEvent
15 inRect:(const NXRect *)cellFrame ofView:aView
16 { // this traps the button being selected.
17 BOOL result = [super trackMouse:theEvent inRect:cellFrame ofView:aView];
18 if (result && [parent respondsTo:@selector(wasSelected:)]) {
19 [parent wasSelected:self];
20 }
21 return result;
22 }
23
24 - performClick:sender
25 {
26 [super performClick:sender];
27 if ([parent respondsTo:@selector(wasSelected:)]) {
28 [parent wasSelected:self];
29 }
30 return self;
31 }
32
33 @end