home *** CD-ROM | disk | FTP | other *** search
/ Nebula / nebula.bin / SourceCode / Palettes / CircularSliderPalette / Instructions < prev    next >
Text File  |  1992-10-01  |  3KB  |  75 lines

  1. The following tells how (?) to convert a 2.1 palette to a 3.0 palette.
  2. It is assumed that the 2.1 palette object(s) is (are) a subclass of View.
  3. You should also consult the NeXT docs "Creating a Custom Palette."
  4.  
  5. 1) Make a new directory called, say, xxxPalette. Start ProjectBuilder (PB)
  6. and select NEW, choosing Patette as the type from the Save Panel. Go to
  7. your xxxPalette directory and click OK. (This creates the files: Makefile,
  8. xxxPalette.h/m, palette.table, PB.gdbinit, and PB.project.)
  9.  
  10. 2) Remove xxxPalette.m from Classes and add it to Other Sources (under Files).
  11. Add your view .m file (call it xxxView.m) into the Classes list. 
  12. Add xxxInspector.m and any other support files into the Other Sources list.
  13. Note that the .h files will automatically be added under Headers.
  14.  
  15. 3) Modify the following files (practically everything):
  16.  
  17.     a) xxxView.m/h -- Change the method -inspectorName to
  18.     -getInspectorClassName.
  19.  
  20.     b) xxxInspector.m/h -- Remove +finishLoading and
  21.     +startUnloading. (Note that nib files are no longer 
  22.     stored in the Mach header. They are simply files (folders,
  23.     actually) in the palette folder.) Also, remove -ok and -revert
  24.     from the .h file, they are now in the superclass (IBInspector).
  25.     Modify the -init method by removing
  26.  
  27.     [NXApp loadNibSection:"CircularSliderInspector.nib" owner:self];
  28.  
  29.     and adding
  30.  
  31.   char buf[MAXPATHLEN + 1];
  32.       
  33.    [[NXBundle bundleForClass:[xxx class]] getPath:buf 
  34.     forResource:"xxxInspector" ofType:"nib"];
  35.    [NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
  36.  
  37.     Add the method
  38.  
  39.     - (BOOL)wantsButtons
  40.     {
  41.         return YES;
  42.     }
  43.  
  44.     (You may return NO here and connect the objects in the inspector
  45.     panel to the -ok action using IB for automatic updating.)
  46.     In the .h file, make xxxInspector a subclass of IBInspector.
  47.     Change #import <nib/InterfaceBuilder.h> to 
  48.     #import <apps/InterfaceBuilder.h>. Make sure -ok and -revert
  49.     return [super ok/revert:sender]. (See the NeXT docs on creating
  50.     a custom palette.)
  51.  
  52.  
  53.     Modify the xxxInspector.nib file by loading it into IB and 
  54.     subclassing it to IBInspector (first remove (ie, cut) the Inspector
  55.     subclass.) Rename this subclass and Parse in the xxxInspector.h.
  56.     Save the nib file and add it to the project. Localize this file.
  57.     [Having fun so far?]
  58.  
  59.     c) Load xxxPalette.nib into IB (note the automatic connection
  60.     to originalWindow) and add a customView of the correct size to
  61.     the Panel. Subclass View and Parse in your View.h code. Make the
  62.     customView of this class type. Save.
  63.  
  64.     d) Add the tiff icon to the project (Note only one is needed,
  65.     do away with the xxxH.tiff file.)
  66.  
  67.     e) Modify the Icon and Export Class part of the palette.table
  68.     file.
  69.  
  70.     f) Add any additional Makefile.pxxx to the Supporting Files
  71.     category of the project.
  72.  
  73.  
  74. 4) Build the palette and load into IB.
  75.