Re: Weird sheet behavior (I think)
Re: Weird sheet behavior (I think)
- Subject: Re: Weird sheet behavior (I think)
- From: Jan Van Tol <email@hidden>
- Date: Sun, 13 Apr 2003 18:21:55 -0500
I believe [NSApp mainWindow] will return nil if another application is
in the foreground. And further, I think the beginSheet method will run
it as a window if that argument is nil (as it probably is in this case).
-Jan Van Tol
On Saturday, April 12, 2003, at 08:50 PM, Matt Bigarani wrote:
Hi,
I've got a window I'm popping up as a sheet in my prefPane. To get the
sheet to slide down, the user drags an application onto an NSTableView
in my prefPane. If the application can't be located in my database, it
pops open a sheet with the list of applications that weren't found.
Problem is, if the Finder is in front when they drop the file on my
NSTableView, and the sheet gets the command to open, it opens up as a
regular window. On the other hand, if I open the applications folder
up in the Finder, bring my prefpane to the front, and then drag the
application(s) in, keeping the prefpane in front, the sheet slides
down the way it's 'supposed' to. Bug? Normal? Something I've done?
Simple code:
[NSApp beginSheet:notFoundWindow
modalForWindow:[NSApp mainWindow]
modalDelegate:self
didEndSelector:@selector(notFoundDidEnd:returnCode:contextInfo:)
contextInfo:nil];
I'm trying to keep the behavior consistent.. It's possible I've
overlooked something. I've tried doing this:
[[NSApp mainWindow] makeKeyAndOrderFront:self];
[[NSApp mainWindow] orderFrontRegardless];
before the beginSheet: code, and it doesn't have any effect.
I went through Apples notes on sheets, and I didn't find anything that
said the sheet would appear as a regular window if the target window
wasn't key. Am I using sheets incorrectly? If this behavior is
consistent and it's not just something I've done, then it seems like
cocoa expects that the window you're sliding the sheet out of is in
front.
Thanks,
Matt Bigarani <email@hidden>
www.myndlinksw.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.