Re: Showing a modal dialog using -runModalForWindow in an effect
Re: Showing a modal dialog using -runModalForWindow in an effect
- Subject: Re: Showing a modal dialog using -runModalForWindow in an effect
- From: Steve Christensen <email@hidden>
- Date: Fri, 30 May 2008 18:11:39 -0700
I wouldn't suggest displaying a window in -initWithAPIManager: since
that can get called rather early in the startup process when the host
app may not be ready to deal with an unexpected window. A better
place would be in -frameSetup:hardware:software: since by then the
world is set up and the user has just selected your effect. I tried
this in a little test plugin and it seemed to work just fine:
- (BOOL)frameSetup:(FxRenderInfo)renderInfo
hardware:(BOOL*)canRenderHardware
software:(BOOL*)canRenderSoftware
{
static BOOL sWindowHasBeenShown = NO;
if (!sWindowHasBeenShown)
{
sWindowHasBeenShown = YES;
TestFxPlugWindowController* controller =
[[TestFxPlugWindowController alloc]
initWithWindowNibName:@"TestFxPlug"];
[controller showWindowModally];
}
*canRenderSoftware = NO;
*canRenderHardware = YES;
return YES;
}
On May 30, 2008, at 5:26 PM, Micah Sharp wrote:
We don't do it at startup, but we do insert an Options button that
brings up a carbon dialog. Not sure if that is helpful, but we've
seen no problems.
Micah
On Fri, May 30, 2008 at 4:59 PM, Matt Rhodes <email@hidden>
wrote:
Hey Team.
We have the need to show a modal dialog box when our effect is
first displayed.
Is there a recommended place to do this? We're currently doing
this in -initWithApiManager
I'm trying to use -runModalForWindow for the modal dialog. I grab
an NSWindow in a .xib (.nib)
file and can display it with -runModalForWindow.
I'm getting some random crashes after showing the dialog. The
problem seems to be
that as an effect I don't really have an NSApplication to hang
onto and
-runModalForWindow requires it.
I'm currently using [NSApplication sharedApplication].
Has anyone done this, or something like this? I'd appreciate any
advice or sample code regarding showing a modal dialog when
an effect starts.
Thanks.
Matt Rhodes
Zaxwerks, Inc.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden