home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Examples / TreeView / treething / text0000.txt < prev   
Encoding:
Text File  |  1993-03-18  |  1.8 KB  |  49 lines

  1.  
  2. > X-Delivered: at request of weiner on infocomm
  3. > Date: Thu, 18 Mar 93 16:34:14 -0700
  4. > From: yackd@maine.et.byu.edu (Don Yacktman)
  5. > > I guess if would be easy to write if I knew how to draw lines between buttons
  6. > > (nodes) to connect them but this will be my first NeXTSTEP program and I
  7. > > don't know how to do anything with DPS yet.
  8. > > Also, if it is so easy to do, it is surprising that no one else has an object
  9. > > to do this.
  10. > Good point...I think it would be easy though, so if you tell me what you
  11. > want, I bet I could whip something up quick and then put it on the net
  12. > as a GNU copylefted thing...
  13.  
  14. Great.  Here's what I would want.  The tree class could read in a tree from
  15. a file in textual form.  The first line is the name of the tree.
  16. In textual form, each node in the tree is given by its label, which can be
  17. any text, including spaces on a single line.  The node's position in the tree
  18. is given by its preceding indentation, normally using 3 spaces of indentation
  19. per level (the amount can be figured out by examining the first indented
  20. label and counting its spaces.  An example:
  21.  
  22. Tree Name
  23. Root
  24.    Node 1
  25.       Node 1.1
  26.          Node 1.1.1
  27.    Node 2 has this longer label.
  28.  
  29.  
  30. After the tree is read in, it is displayed within a new view.  Each node is
  31. created as a selectable button with the appropriate label and lines
  32. connecting it to its parent and children.  (Let's assume only one button can
  33. be selected at a time.)
  34.  
  35. When a button is selected, a string consisting of the tree name and the node
  36. selected is sent to an output stream.  (stdout is fine as a default.), e.g.
  37.  
  38.     Tree Name^^Node 1.1 
  39.  
  40. could be output with ^^ indicating separation of the two arguments.
  41.  
  42. That's it.  Then my other program takes this standard output and displays
  43. text associated with the selected node.
  44.  
  45.  
  46.