• 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: When do documents position windows?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When do documents position windows?


  • Subject: Re: When do documents position windows?
  • From: Marco Scheurer <email@hidden>
  • Date: Thu, 6 Jun 2002 19:01:39 +0200

On Thursday, June 6, 2002, at 05:18 pm, Donald Brown wrote:

I'm having a lot of trouble getting my document windows to remember
position. I've given up on autosaveframename, and instead am calling

setFrameUsingName from my Document's windowControllerDidLoadNib

saveFrameUsingName from the window's delegate windowWillClose method

In both places, I call NSLog([[self window] stringWithSavedFrame]); and I
get the same result on open that I had on the previous load. And yet, my
document is shifted down about an inch and to the right about a half inch.
So, apparently something (I presume the document class) is shifting my
window behind my back.

Should I be calling setFrameUsingName elsewhere? Or is there some other
reason I haven't figured out. I had been setting setFrameAutosaveName from
the windowControllerDidLoadNib, with the same result.

Tis a puzzlement.

The problem is that in the case of document windows (i.e. you are using NSDocument/NSDocumentController) while the window size is set, the position is ignored. More exactly, it must be reset by a cascadeTopLeftFromPoint message sent to the window after your setFrameUsingName. You could imagine sending setFrameUsingName after a delay, but then you will probably loose the cascading effect.

I gave up on this, and hope Apple will fix this behavior. I have yet to see a multiple-document app that remembers the last window's position.


Marco Scheurer
Sen:te, Lausanne, Switzerland http://www.sente.ch
_______________________________________________
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.

  • Follow-Ups:
    • Re: When do documents position windows?
      • From: Donald Brown <email@hidden>
References: 
 >When do documents position windows? (From: Donald Brown <email@hidden>)

  • Prev by Date: Re: Why does the memory increase?
  • Next by Date: Re: When do documents position windows?
  • Previous by thread: Re: When do documents position windows?
  • Next by thread: Re: When do documents position windows?
  • Index(es):
    • Date
    • Thread