FROM : Mike Vannorsdel
DATE : Thu Jan 09 23:32:01 2003
Only use
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: to
open the sheet. You need to also supply a modal delegate object (which
has the didEndSelector: message for this sheet). Only in your
didEndSelector: message should you put endSheet: and orderOut:.
So your two problems was using runModalForWindow: (which is for stand
alone modal windows, not sheets) and using endSheet: and orderOut:
right after opening the sheet. Unlike runModalForWindow:,
beginSheet... does not wait for the sheet to be closed to return.
On Thursday, January 9, 2003, at 01:25 PM, iUNI Technologies Corp.
wrote:
> I am trying to create a sheet for a window but I keep getting "Modal
> session requires modal window" error at runtime.
>
> I have two nib files, the parent window (mainWindow) is in the first
> nib while the sheet window is in the second nib file. I am not sure
> how to connect the two via IB either.
>
> I'm stuck!
>
> [NSApp beginSheet:nagWindow
> modalForWindow:[Controller valueForKey:@"mainWindow"]
> modalDelegate:nil
> didEndSelector:nil
> contextInfo:nil];
> [NSApp runModalForWindow:nagWindow];
> [NSApp endSheet:nagWindow];
> [nagWindow orderOut:self];
DATE : Thu Jan 09 23:32:01 2003
Only use
beginSheet:modalForWindow:modalDelegate:didEndSelector:contextInfo: to
open the sheet. You need to also supply a modal delegate object (which
has the didEndSelector: message for this sheet). Only in your
didEndSelector: message should you put endSheet: and orderOut:.
So your two problems was using runModalForWindow: (which is for stand
alone modal windows, not sheets) and using endSheet: and orderOut:
right after opening the sheet. Unlike runModalForWindow:,
beginSheet... does not wait for the sheet to be closed to return.
On Thursday, January 9, 2003, at 01:25 PM, iUNI Technologies Corp.
wrote:
> I am trying to create a sheet for a window but I keep getting "Modal
> session requires modal window" error at runtime.
>
> I have two nib files, the parent window (mainWindow) is in the first
> nib while the sheet window is in the second nib file. I am not sure
> how to connect the two via IB either.
>
> I'm stuck!
>
> [NSApp beginSheet:nagWindow
> modalForWindow:[Controller valueForKey:@"mainWindow"]
> modalDelegate:nil
> didEndSelector:nil
> contextInfo:nil];
> [NSApp runModalForWindow:nagWindow];
> [NSApp endSheet:nagWindow];
> [nagWindow orderOut:self];
| Related mails | Author | Date |
|---|---|---|
| iUNI Technologies… | Jan 9, 12:32 | |
| Chris Reed | Jan 9, 15:44 | |
| Mike Vannorsdel | Jan 9, 23:32 |






Cocoa mail archive

