• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: displaying window on activation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: displaying window on activation


  • Subject: Re: displaying window on activation
  • From: Allan Odgaard <email@hidden>
  • Date: Sun, 3 Oct 2004 11:00:06 +0200

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.


--
http://macromates.com/ ::: TextMate, OS X text editor
http://macromates.com/sigpipe/ ::: Personal weblog about programming

_______________________________________________
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
  • Follow-Ups:
    • Re: displaying window on activation
      • From: Chuck Soper <email@hidden>
References: 
 >displaying window on activation (From: Chuck Soper <email@hidden>)

  • Prev by Date: Re: Toggle between Alternate Menus
  • Next by Date: Re: rtfd example
  • Previous by thread: displaying window on activation
  • Next by thread: Re: displaying window on activation
  • Index(es):
    • Date
    • Thread