Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Tortoise001

macrumors newbie
Original poster
May 14, 2008
1
0
Hi,
I have used Window's MFC to embed controls like comboBox, pushBottons to a Modal dialog box, I am wondering how similar things can be done with XCode and Cocoa, I am very new to Mac GUI programming, I need some directions as to where to start...
E.g. In Windows, I first create a placeholder (picture frame) in Dialog Box using resource editor (similar to Mac's interface builder), then I wrote code to create controls using that placeholder ID. Are there similar concepts in Mac?
Thanks a lot...
 
How modal is modal? Is this like a "This application failed" modal, or "This document needs to do something" modal?

On OS X you have two levels of modal. Sheets (usually recommended) are modal for a particular window, usually a document or the main app window if you aren't document-based. Then you have application modal windows.

In OS X, a dialog is simply a window (if they are application modal), a sheet is usually a panel. You can add this to your UI in interface builder, and lay out the sheet or window like any other window. There are a couple APIs that let you setup a window to run as modal in Cocoa.

Application Modal:
http://developer.apple.com/document...ef/occ/instm/NSApplication/runModalForWindow:

Window Modal (Sheet):
http://developer.apple.com/document...dow:modalDelegate:didEndSelector:contextInfo:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.