Re: makeKeyAndOrderFront (not working)
Re: makeKeyAndOrderFront (not working)
- Subject: Re: makeKeyAndOrderFront (not working)
- From: Pax <email@hidden>
- Date: Sun, 14 Apr 2013 19:20:10 +0100
Perfect (well, perfect barring extended testing). So far this seems to do the trick:
[[NSApplication sharedApplication] activateIgnoringOtherApps : YES];
Thanks for the suggestion. If it breaks something else I'll be sure you let you know.
On 14 Apr 2013, at 17:47, Uli Kusterer <email@hidden> wrote:
> I think the problem may be your UIElement-ness. It's been ages since I worked on a UIElement app, and when I did it had to pop something up on the screen atop of everything, so I just put my window in the floating window layer (or was it called Utility window level? Well, one of the CGWindowLevel constants that you can pass to NSWindow's setLevel:).
>
> I'm not sure if there is a way to bring windows with a document window level to front, but what I'd try is activating your application. I think NSApplication has a method to bring it to front, or make it active, or whatever the terminology was. Makes it the front process and swaps in its menu bar (which of course won't happen for your UIElement). Well, I'd try that, it may or may not work.
>
> Hope these clues help you in figuring it out.
>
> Cheers,
> -- Uli Kusterer
> "The Witnesses of TeachText are everywhere..."
> http://www.zathras.de
>
>
> On 14.04.2013, at 18:33, Pax <email@hidden> wrote:
>> I want my window to come to the front when I select it. My window (with its own class to handle it), sadly, has other ideas - and stays resolutely in the background. Complicating matters, my app is faceless - just a menu item to show for itself, and no icon in the dock. The code I'm having problems with is as follows:
>>
>> -(void) configureWindow:(id)owner
>> {
>> [self showWindow:owner];
>> [infoWindow cascadeTopLeftFromPoint:NSMakePoint(20,20)];
>> [infoWindow makeKeyAndOrderFront:owner];
>> }
>>
>> configureWindow is called as follows (from AppDelegate.m):
>> [[device objectForKey:@"InformationWindowRef"] configureWindow:self];
>>
>> And the info.plist for the app contains:
>> Application is agent (UIElement) YES
>>
>> Given enough time, I may well crack this - but if anyone has a clever idea for where I've gone wrong then I'd love to hear it.
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>>
>> This email sent to email@hidden
>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden