Tuesday, August 5, 2008

Window's Content View


This is in the "you learn something every day category." (As in, something obvious you should have noticed before). When displaying a view that will take up the whole window, I learned to grab a Custom View object from the palette in IB and dragged it to the window, then make it fill the window (and anchor it to the window for resizing). But, all you have to do really is to click on the blank window a second time. As with an NSTableView, you get different objects, shown using the Inspector. If you click once, you get "Window Identity." If you click twice, you get "View Identity." This is the contentView of the window! Just set the class name of that to be the one you define in code. No need for anything else.