• 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: Window layering and save sheet attachment in multi-window document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Window layering and save sheet attachment in multi-window document


  • Subject: Re: Window layering and save sheet attachment in multi-window document
  • From: Sherm Pendley <email@hidden>
  • Date: Wed, 30 Nov 2005 22:06:59 -0500

On Nov 30, 2005, at 9:59 PM, Derrick Bass wrote:

I have a multi-window document with a main window and several (optional, controlled by user defaults) subsidiary windows. Only the main window has shouldCloseDocument set to YES.

I'd like the main window to be in front when the user opens a document, but it appears that the last window created is always in front. I tried telling the main window to makeKeyAndOrderFront at the end of the makeWindowControllers method, but it didn't seem to do anything; stepping through the code showed that the windows don't show themselves until well after that function is over; that is presumably why makeKeyAndOrderFront is being ignored.

You could do that in -windowControllerDidLoadNib:. If you don't want the visual artifact of the windows appearing out of order, then rearranging, uncheck the "visible on startup" property in Interface Builder. That way they won't be shown until you do eventually call - makeKeyAndOrderFront:.


So I tried creating the windows in the opposite order; subsidiary windows first, main window last. But there's another problem with that. The save sheet appears on the subsidiary window instead of the main window, which I don't like.

Override -windowForSheet in your NSDocument subclass.

sherm--

Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

_______________________________________________
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


References: 
 >Window layering and save sheet attachment in multi-window document (From: Derrick Bass <email@hidden>)

  • Prev by Date: Window layering and save sheet attachment in multi-window document
  • Next by Date: CoreData, TextView and Bindings
  • Previous by thread: Window layering and save sheet attachment in multi-window document
  • Next by thread: CoreData, TextView and Bindings
  • Index(es):
    • Date
    • Thread