Search code examples
objective-ccocoamacososx-snow-leopard

Modal window Cocoa app


I just recently started making apps for OSX desktops and I want to have the users click a button and a window come up, similar to the following screenshots. What is that window that comes up called? You can't quit the application when you're entering the information. I tried looking for ways to make an NSAlert do this, but I was way off. Can someone please point me in the right direction? Thanks in advance!

enter image description here

enter image description here


Solution

  • The common name for what's shown in those images is a "sheet".

    Technically, this is generally accomplished using 2 NSWindows (or NSPanels), one of which is termed the sheet, and which is shown modally against the second window, which serves as the main window the sheet appears from.

    See Sheet Programming Topics.

    While I believe you can use NSAlert's for displaying simple dialogs in this fashion, the setup shown in those images was most likely accomplished by using a custom sheet. See Using Custom Sheets.