RE: When do documents position windows?
RE: When do documents position windows?
- Subject: RE: When do documents position windows?
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Thu, 6 Jun 2002 12:04:13 -0400
Garfinkel & Mahoney say to do this in the controller class:
- (void)awakeFromNib
{
[window setFrameUsingName:@"Main Window"];
[window setFrameAutosaveName:@"Main Window"];
}
You don't need to implement anything in the delegate's windowWillClose.
In addition, I think your window would shift if you closed it while it was
partially off-screen. The next time you opened it, it would be drawn so it
would be entirely visible. A change in screen resolution also might change
the apparent position, but that doesn't seem to be your problem.
Jonathan
>
-----Original Message-----
>
From: email@hidden
>
[mailto:email@hidden]On Behalf Of Donald Brown
>
Sent: Thursday, June 06, 2002 11:19 AM
>
To: Cocoa dev
>
Subject: When do documents position windows?
>
>
>
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.
>
>
Donald
>
>
--
>
Donald Brown
>
email@hidden
>
http://www.eamontales.com
>
>
We have met the enemy and he is us - Pogo
>
_______________________________________________
>
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.
_______________________________________________
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.