• 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: Initial Window position
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Initial Window position


  • Subject: Re: Initial Window position
  • From: Tom Sutcliffe <email@hidden>
  • Date: Wed, 7 May 2003 17:51:03 +0100

Is there a built in facility in Cocoa for initial window positioning? The
non-panel windows I've got seem to be coming up wherever I left them in the
nib.

Yes that is the default behaviour. If you don't want to set up window positions in Interface Builder you can call
[aWindow setFrameOrigin: somePoint]
before you show the window on screen with orderFront or whatever.

Along the same lines, if the saved window position in the prefs ends up off
the screen (as when someone has changed their monitor layout between runs)
will Cocoa automatically snap the windows back to the visible area?

Again yes, there is a method constrainFrameRect:toScreen: defined on NSWindow that is called whenever a window is about to be placed onscreen. It makes sure the window is visible and not covering the menu bar.

On a related note in Cocoa, has option-clicking the zoom window widget always zoomed all other windows in the same application? I ask because it doesn't do that in Carbon apps, nor did it under OS 9. (I was expecting it to still zoom to full screen... sometimes the "standard frame" is just not what you want to zoom to)

Failing a built in facility for these things does anyone have a link to
avoid reinventing the wheel?

But reinventing wheels is fun - especially when you discover that 'round' wasn't the best shape after all ;)
But then again in Cocoa you usually find someone's already done any reinventing that is worth doing, and in fact has a class cluster for n-sided and (m-dimensional) wheels...

Regards,

Tom
_______________________________________________
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.

References: 
 >Initial Window position (From: Brooks Bell <email@hidden>)

  • Prev by Date: Re: Tracking mouse activity in NSToolbar?
  • Next by Date: Re: Getting and displaying application icons
  • Previous by thread: Initial Window position
  • Next by thread: Re: Initial Window position
  • Index(es):
    • Date
    • Thread