163
|
1 //
|
|
2 // NamedTree.m -- a generic class to build tree data structures
|
|
3 // This class requires the String class, also by Don Yacktman.
|
|
4 // Written by Don Yacktman (c) 1993 by Don Yacktman.
|
|
5 // All rights reserved.
|
|
6 //
|
|
7 // You may use and copy this class freely as long as you
|
|
8 // comply with the following terms:
|
|
9 // (1) If you use this class in an application which you
|
|
10 // intend to sell commercially, as shareware, or otherwise,
|
|
11 // you may only do so with express written permission
|
|
12 // of the author. Use in applications which will
|
|
13 // be distributed free of charge is encouraged.
|
|
14 // (2) You must include the source code to this object and
|
|
15 // all accompanying documentation with your application,
|
|
16 // or provide it to users if requested, free of charge.
|
|
17 // (3) Do not remove the author's name or any of the
|
|
18 // copyright notices
|
|
19 //
|
|
20
|
|
21 #import "NamedTree.h"
|
|
22 #import "TreeView.h"
|
|
23
|
|
24 @implementation NamedTree
|
|
25
|
|
26 - setTreeName:string { treeName = string; return self; }
|
|
27 - (const char *)treeName { return [treeName stringValue]; }
|
|
28
|
|
29 - activateNode:sender
|
|
30 {
|
|
31 // int msgDelivered;
|
|
32
|
|
33 // this action message is sent whenever the button associated with
|
|
34 // this node is clicked by the user.
|
|
35 [[sender superview] setCurrentButton:sender];
|
|
36 [self act:sender];
|
|
37 return self;
|
|
38 }
|
|
39
|
|
40 - act:sender
|
|
41 {
|
|
42 const char* nodeVal = [((value) ? value : label) stringValue];
|
|
43
|
|
44 printf("%s^^%s^^%s\n", [self treeName], "br-edit", nodeVal);
|
|
45 // msgDelivered = [[NXApp appSpeaker] selectorRPC:"nxBrowserMsg"
|
|
46 // paramTypes:"ccc",
|
|
47 // [self treeName], "br-edit", nodeVal];
|
|
48 // if (msgDelivered != 0)
|
|
49 // fprintf(stderr, "Class display request not accepted.\n");
|
|
50
|
|
51 return self;
|
|
52 }
|
|
53
|
|
54 @end
|