Version: 1.5

Posted: 2007-05-29

Build Requirements: Xcode 3.0 (or the latest)

Runtime Requirements: Mac OS X 10.5

View Source Code:

Download Sample (“HIView-NSView.zip”, 117.0K)
Download Sample (“HIView-NSView.dmg”, 178.2K)



Description

Demonstrates how to embed an NSView within an HIView in a Carbon window. This Carbon sample includes both a Carbon and a Cocoa nib file. The Cocoa nib, WebView.nib, contains a view hierarchy embedded in a top level NSView. After a new Carbon window is created, an NSViewController is used to load the Cocoa nib and get a reference to the top level view. The NSView hierarchy is then embedded in an HICocoaView. All the connections made in Interface Builder are preserved. NSViews can be created manually or with Interface Builder.

Document Revision History

Date Notes
2007-05-29Upgraded to use NSViewController.
2007-02-14Fixed bug: no longer prematurely releasing the WebWindowController object, minor UI layout improvements with regards to view sizes and resizing, added "Go" button.
2007-01-12Added WebKit Framework to correct a runtime problem.
2006-08-02added NSAutoReleasePool before calling DoNewWindow()
2006-07-28Demonstrates how to embed an NSView within an HIView in a Carbon window.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.