|
|
Epilogue:
That was easy, eh? Here are some things you can do to enhance your word processor:
0. Rename "My Window" to "Untitled" so that the title starts in the right state. This is trivial to do in IB's Inspector, "Attributes" when the window is selected in the Instance browser.
1. Add multiple documents to your app by creating a separate nib file which is owned by the WordDelegate class. See /NextDeveloper/Examples/AppKit/TextEdit for a very powerful, yet simple TextEditor which allows multiple docs (Document.h & Document.m).
2. Add an Application Icon by creating a 48*48 icon (/NextDeveloper/Apps/IconBuilder.app), saving it, and then dragging it from the FileViewer to the "Project" icon well in ProjectBuilder's inspector, and recompiling.
3. Add Find - TextFinder.h, TextFinder.m and FindPanel.nib and FindPanel.strings from TextEdit contain the functionality you need. This is much vaunted "code reuse" of object programming!
4. Create methods for SaveAs... Again, look at the document architecture in the /NextDeveloper/Examples/Appkit folder.
5. Add an "About..." panel. Drag in a panel from the IB palette and connect the "About..." menu item to this panel, with an action of "orderFront:".
6. Add Tool Tips. Simply create an rtf file for each object that you want give popup help to, and attach to the user interface object in IB, Inspector->Help.
7. Make the OpenPanel and SavePanel remember their last opened directory by making those variables static, and "retaining" them.
- (void)saveText:(id)sender
{
// Create a static variable lives between invocations:
static NSSavePanel *savePanel = nil;
// If it's the first time through, get a new Save Panel:
if (savePanel == nil) {
NSSavePanel *savePanel = [[NSSavePanel savePanel] retain];
...
// Now, it will 'remember' it's last chosen directory...
Anyway, I hope this gives you a taste for the elegance and comfort of the finely integrated Rhapsody development tools.
Andrew C.Stone, Albuquerque New Mexico
|
|