Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to make a window appear infront of all other app windows?

How to make a window appear infront of all other app windows?
Thread Tools
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Jun 3, 2003, 11:29 AM
 
Hey guys, im opening a nib, but the problem is, when I do it. It appears infront, its has the opaque title bar. What im after is making it appear in front and selected, heres my opening code:

- (void)openPrefs
{
if (!prefOpenWindow) {
if (![NSBundle loadNibNamed:@"Preferences" owner:self]) {
NSLog(@"Failed to Preferences.nib");
NSBeep();
return;}
[[prefOpenWindow window] setExcludedFromWindowsMenu:YES];
[[prefOpenWindow window] setMenu:nil];
[[prefOpenWindow window] center];
}
[[prefOpenWindow window] makeKeyAndOrderFront:nil];
}

- (void)openPrefsClick:sender;
{
[self openPrefs];
}
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Jun 3, 2003, 11:43 AM
 
Try changing:

[[prefOpenWindow window] makeKeyAndOrderFront:nil];

To:

[[prefOpenWindow window] makeKeyAndOrderFront:self];

Not sure, just a guess...
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
Grizzled Veteran
Join Date: Jun 2002
Status: Offline
Reply With Quote
Jun 3, 2003, 12:04 PM
 
No, that didn't do it. Anyone else got any ideas?
     
Senior User
Join Date: Feb 2003
Location: USA
Status: Offline
Reply With Quote
Jun 3, 2003, 12:32 PM
 
Hmm, not sure then. Here's a snippet from one of my apps that loads a window and brings it to the front:

if (!custwindowcontroller)
{
custwindowcontroller = [[CustWindowController alloc] initWithWindowNibName:@"customers"];
}
[custwindowcontroller showWindow:self];

Even if the app has other windows open it still becomes the frontmost app.
The above was probably not helpful, I just like to try...
MacBook 2.0 160/2GB/SuperDrive
Lots of older Macs
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 03:39 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2