Re: window focus trouble
Re: window focus trouble
- Subject: Re: window focus trouble
- From: email@hidden
- Date: Mon, 4 Mar 2002 14:57:47 -0800
The problem is that you are calling makeKeyAndOrderFront too soon! Both
applicationWillFinishLaunching and even applicationDidFinishLaunching
are
called BEFORE the regular event loop starts running, so requests like
makeKeyAndOrderFront can't be handled yet. One way around this is to
call a
method with a delay of zero that does the makeKeyAndOrderFront. As soon
as
event processing gets started your "delayed" code will run, and this
will
bring your window to the front.
Hmm, this doesn't sound right to me. I run an NSPanel in the
applicationDidFinishLaunching: method of my app delegate in pretty much
every app I've written in the past year, and I've never experienced a
problem.
Myself, I was gonna guess that the root of the problem lay somewhere
in all the wacky Scheme stuff the guy was doing, and the fact that he
was avoiding using NSRunLoop completely. :-> The Kit kind of relies on
NSRunLoop being used; it does a lot more than just deliver events to
NSApplication. I don't know for sure that that's the problem with your
app, but if it isn't giving you problems now, it will soon. :-> You
should be able to use -[NSRunLoop runMode:beforeDate:] or the other
similar methods to cycle the run loop, if you really don't want
NSApplication to do this for you.
Ben Haller
Stick Software
_______________________________________________
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.