Re: displaying window on activation
Re: displaying window on activation
- Subject: Re: displaying window on activation
- From: Chuck Soper <email@hidden>
- Date: Sun, 3 Oct 2004 13:09:52 -0700
At 11:00 AM +0200 10/3/04, Allan Odgaard wrote:
On 1. Oct 2004, at 21:43, Chuck Soper wrote:
I'm trying to figure out how to make a window key and ordered front
when receiving a NSApplicationDidBecomeActiveNotification (kind of
like the BBEdit8 demo in functionality). The window is a demo
dialog instantiated from an NSWindowController in its own nib. [...]
[demoWindow center];
[demoWindow makeKeyAndOrderFront:nil];
[demoController showWindow:nil];
NSWindow * mainWindow = [NSApp mainWindow];
if (mainWindow != nil) {
int windowNumber = [demoWindow windowNumber];
[mainWindow orderWindow:NSWindowBelow relativeTo:windowNumber];
}
Try to remove all these lines, as the runModalForWindow: method will
center, bring to front, set level to dialog (so it floats above
other windows) etc.
Probably it doesn't work because the window is already on screen
when you call it.
Allen,
Thanks for your good suggestion. It seems like it should have made it
work, but removing the lines did not affect the behavior. My demo
window is activated properly when the application becomes active by
clicking on its icon in the dock. The demo window is not activated
when the application becomes active by clicking on one of its
windows. I think this is the problem. Could it be that the app window
is attempting to become main shortly after the runModalForWindow:
method is sent (on application activation)?
Chuck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden