dialogs comming from the window title

popey.marin

Registered
Hello
Which class should I use to have a dialogue that comes out from the title barre of a window like the save or the open dialogue (sorry, I don't rememeber the name of that kind of dialogue) ?
How can I define the items in this dialgue whith Interface Builder ?

Thank you for your answers
 
Those are sheets. You might try searching for "sheets" in the IB help or the Dev documentation. I haven't messed around with the IB long enough to tell you for sure but you probably have to add a sheet object to a window.

Any one else know of any good sources of info for learning to use IB?
 
You have to invoke it programaticly. Currently Sheets are Cocoa-only. You can do it by [NSApp runModal:sheetname forWindow:windowname ...] or something like that. look at apple's Documentation on NSApplication. Hope this helps you.
 
Actually I just noticed that Carbon apps can use sheets. Sherlock uses a sheet for errors, the Finder uses a sheet for the goto field. If I find anymore examples of this I'll post them.

Here's another question though, when you use the command to create the sheet how do you edit the interface?
 
You use the command in the moment you want to get the sheet.

- (void)beginSheet:(NSWindow *)sheet
modalForWindow:(NSWindow *)docWindow
modalDelegate:(id)modalDelegate
didEndSelector:(SEL)didEndSelector
contextInfo:(void *)contextInfo

sheet can be a window you created in Interface Builder
docWindow is the window showing the sheet
[modalDelegate didEndSelector] is invoked when the sheet ends
contextInfo don't know it myself

So lets say you have two windows: window1 and window2.
When you want to run window1 as a sheet for window2, you would type
[NSApp beginSheet:window1 modalForWindow:window2 modalDelegate:nil didEndSelector:nil contextInfo:nil];
I haven't tried if this functions with all the nils.
 
Thank you for all your replys.
I've tried the beginSheet and endSheet in my java program, it works fine.
But I'd like to focus on the fact that I had to use a NSPanel in IB to create the sheet : whith a NSWindow, the sheet appears in the center of the screen, and don't roll out of anywhere.
 
Back
Top