0

I have implemented my sheet (NSPanel) with the following method:

- (void)showInWindow:(NSWindow *)mainWindow {
if (!finestra1)
    [NSBundle loadNibNamed:@"XibName" owner:self];

[NSApp beginSheet:finestra1 modalForWindow:mainWindow modalDelegate:nil didEndSelector:nil contextInfo:nil];
[NSApp runModalForWindow:finestra1];   //This call blocks the execution until [NSApp stopModal] is called

}

The sheet is appearing in the middle of my screen, how to attach it to the top of my main window and make it appear with a "slide down" effect instead?

Thanks in advance.

Alberto
  • 4,212
  • 5
  • 22
  • 36

2 Answers2

2

Have you tried simply removing the -runModalForWindow: line?

paulmelnikow
  • 16,895
  • 8
  • 63
  • 114
0

The way I was taught, the sheet you're presenting should be an NSWindow, not an NSPanel.

Let me know if you'd like me to upload a simple demo project.

John Sauer
  • 4,411
  • 1
  • 25
  • 33