9.6. Exercises

  1. Modify the Carbon Email Formatter application to update its result text view whenever you type in a text field. No nib file changes should be necessary. You will need to register a window event handler for a keyboard event type to receive keyboard events. Once you do that, your event handler will receive these events before the Carbon framework has the chance to interpret them. You must use the CallNextEventHandler function to pass the event back to Carbon so text fields will actually update, and then call ComputeResult once CallNextEventHandler returns.

  2. Change Slide Master's Export function to write the name of each image into the lower-right corner of the QuickTime movie. Remember you are working with a QuickDraw port at this point (in the form of a GWorldPtr) and the NSString drawing techniques you learned in Chapter 8 will not directly help you. Instead, use the MLTE function TXNDrawCFStringTextBox to draw the filename.

Get Beginning Mac OS® X Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.