home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / Palettes / TTools / Examples / HOWTO
Encoding:
Text File  |  1993-11-10  |  2.3 KB  |  44 lines

  1. How to create the examples:
  2.  
  3. ClassBrowsing:
  4.  
  5. 1.  IB, New Empty Module.
  6. 2.  Drag out a window
  7. 3.  Drag out a browser, alt-drag it into 3 columns
  8. 4.  Drag out a SortedList object
  9. 5.  Using the ListEditor, change to class mode, add Object class
  10. 6.  Drag out a ClassAgent object
  11. 7.  Make the SortedList's agent the ClassAgent instance
  12. 8.  Make the browser's delegate the SortedList
  13. 9.  Test Interface  (Use switch on appicon to stop).
  14.  
  15. StringBrowsing:
  16.  
  17. 1.  IB, New Empty Module.
  18. 2.  Drag out a window
  19. 3.  Drag out a browser, resize it
  20. 4.  Drag out a SortedList object
  21. 5.  Drag out a StringAgent object
  22. 6.  Connect agent outlet of SortedList to StringAgent
  23. 7.  Connect delegate outlet of browser to SortedList
  24. 8.  Edit SortedList
  25. 9.  Add several instances of String (use object, not class, mode)
  26. 10. Selecting a String in the list, go to attributes browser, change initial stringValue.
  27. 11.  Repeat above; make each string different - enter "stringValue" in the showBy field to keep track.
  28. 12.  Test Interface.
  29.  
  30. NOTE:  Strings will not be in sorted order - awakeFromNib isn't called in Test Interface mode.  At run-time in an application context, the strings will be sorted as soon as the nib is loaded.
  31.  
  32. TimerInspector:
  33.  
  34. 1.  Copy TimerInspector.nib from project
  35. 2.  Drag out a new TBinderList, drag out a Timer
  36. 3.  Connect from TBinderList to Timer, make it the dataSource.
  37. 4.  Connect from TBinderList to each text field, choosing the appropriate dataSource and interface accessor methods.
  38. 5.  Inspect each of the above connections by double-clicking on the connection in the list.  Turn the verify feature on for each one.
  39. 6.  Connect the TBinderList to the three switches (using the state accessor).
  40.  
  41. 7.  Test Interface.  Notice that the dataSource is updated when you hit enter in the TextFields, or click on a button.  This is the "autoUpdate" feature.  Also notice that unacceptable values are "clipped".  Thus, a -1 in the Period field becomes a 0.05 (the smallest allowable period for the Timer object).  This is the verify feature.
  42.  
  43. 8.  Notice the limitations of TBinders.  The pulldown list needs some code behind it, since TBinders can only do direct mappings.  Matrixes of buttons are often used to index an array of unrelated values as well; there is no provision for this kind of thing in TBinders.
  44.