home *** CD-ROM | disk | FTP | other *** search
/ Apple WWDC 1996 / WWDC96_1996 (CD).toast / Technology Materials / Newton Platform Info / Newton 2.0 Sample Code / User Interface / PreeferMadnessTNG-1 / PackageStuff.f < prev    next >
Encoding:
Text File  |  1996-02-19  |  1.2 KB  |  46 lines  |  [TEXT/ttxt]

  1. // Copyright © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  2. /*
  3.     package and part stuff
  4.     
  5.     Includes:
  6.         part frame additions
  7.         InstallScript
  8.         RemoveScript    
  9.  
  10.  */
  11.  
  12.  
  13. // These calls to SetPartFrameSlot need to be done after the layout has
  14. // been compiled, which is why this file is last in the build sequence.
  15.  
  16. SetPartFrameSlot('PreeferFormulaItem, GetLayout("PreeferFormulaItem"));
  17. SetPartFrameSlot('PreeferAutoPrefsItem, GetLayout("PreeferAutoPrefsItem"));
  18.  
  19.  
  20. InstallScript := func(partFrame)
  21. begin
  22.     // NOTE: only auto parts would register their prefs with the
  23.     //            system, and only if there was no other way to present
  24.     //            preferences. This is done here for demonstration purposes
  25.     //            only.
  26.     RegPrefs(kAppSymbol, partFrame.PreeferAutoPrefsItem);
  27.  
  28.     // register the formula.
  29.     // NOTE: can not use GetLayout directly in a form part installScript
  30.     //       since the InstallScript is EnsureInternal'd. If we did do
  31.     //       a GetLayout call, the layout would be copied into the NS Heap!
  32.     RegFormulas(kAppSymbol, partFrame.PreeferFormulaItem);
  33.  
  34. end;
  35.  
  36.  
  37. RemoveScript := func(partFrame)
  38. begin
  39.     // NOTE: only autoparts need to register system prefs... see above
  40.     UnregPrefs(kAppSymbol);
  41.  
  42.     //unregister the formula
  43.     UnregFormulas(kAppSymbol);
  44.  
  45. end;
  46.