|
|
17. In the same control-drag manner, connect the Page Setup... to "First Responder" object in the Instance Browser. This is a very cool "placeholder" object which will send the method to the most appropriate object for the current context of the application. In Rhapsody, there is this notion of a responder chain which begins with the active user interface object (such as the Text if your cursor is blinking there), the window's delegate, the window, then the Application's delegate, and finally, the Application itself. The action is sent to the first object in the chain that responds to it (ie First Responder), and if none do, the menu item is automatically dimmed and disabled. For a full description of the Responder chain, you can access the online documentation via ProjectBuilder: click on "Frameworks" -> "AppKit.framework" -> "Documentation" -> "Reference" -> "Classes" -> "NSResponder.rtf". You will quickly learn how useful these docs are!
In order that our WordDelegate object gets these First Responder method calls, we'll need to insert our WordDelegate into the First Responder chain.
Control-Drag from the "My window" icon in the Instance Browser to the "WordDelegate" instance, and select "delegate" outlet in the Outlets browser of the Window Inspector.
|
|
|
|
|
Control drag from "Page Setup..." menu item in the dropped down File menu to the First Responder icon in the Instances browser. Double-click "runPageLayout:" in the Inspector's Actions browser.
Likewise, Control-drag from "Print..." menu item to the Text portion of the ScrollView. Double-click "print:" in the Actions browser.
|
|