home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula
/
nebula.bin
/
SourceCode
/
Palettes
/
CircularSliderPalette
/
Instructions
< prev
next >
Wrap
Text File
|
1992-10-01
|
3KB
|
75 lines
The following tells how (?) to convert a 2.1 palette to a 3.0 palette.
It is assumed that the 2.1 palette object(s) is (are) a subclass of View.
You should also consult the NeXT docs "Creating a Custom Palette."
1) Make a new directory called, say, xxxPalette. Start ProjectBuilder (PB)
and select NEW, choosing Patette as the type from the Save Panel. Go to
your xxxPalette directory and click OK. (This creates the files: Makefile,
xxxPalette.h/m, palette.table, PB.gdbinit, and PB.project.)
2) Remove xxxPalette.m from Classes and add it to Other Sources (under Files).
Add your view .m file (call it xxxView.m) into the Classes list.
Add xxxInspector.m and any other support files into the Other Sources list.
Note that the .h files will automatically be added under Headers.
3) Modify the following files (practically everything):
a) xxxView.m/h -- Change the method -inspectorName to
-getInspectorClassName.
b) xxxInspector.m/h -- Remove +finishLoading and
+startUnloading. (Note that nib files are no longer
stored in the Mach header. They are simply files (folders,
actually) in the palette folder.) Also, remove -ok and -revert
from the .h file, they are now in the superclass (IBInspector).
Modify the -init method by removing
[NXApp loadNibSection:"CircularSliderInspector.nib" owner:self];
and adding
char buf[MAXPATHLEN + 1];
[[NXBundle bundleForClass:[xxx class]] getPath:buf
forResource:"xxxInspector" ofType:"nib"];
[NXApp loadNibFile:buf owner:self withNames:NO fromZone:[self zone]];
Add the method
- (BOOL)wantsButtons
{
return YES;
}
(You may return NO here and connect the objects in the inspector
panel to the -ok action using IB for automatic updating.)
In the .h file, make xxxInspector a subclass of IBInspector.
Change #import <nib/InterfaceBuilder.h> to
#import <apps/InterfaceBuilder.h>. Make sure -ok and -revert
return [super ok/revert:sender]. (See the NeXT docs on creating
a custom palette.)
Modify the xxxInspector.nib file by loading it into IB and
subclassing it to IBInspector (first remove (ie, cut) the Inspector
subclass.) Rename this subclass and Parse in the xxxInspector.h.
Save the nib file and add it to the project. Localize this file.
[Having fun so far?]
c) Load xxxPalette.nib into IB (note the automatic connection
to originalWindow) and add a customView of the correct size to
the Panel. Subclass View and Parse in your View.h code. Make the
customView of this class type. Save.
d) Add the tiff icon to the project (Note only one is needed,
do away with the xxxH.tiff file.)
e) Modify the Icon and Export Class part of the palette.table
file.
f) Add any additional Makefile.pxxx to the Supporting Files
category of the project.
4) Build the palette and load into IB.