J john903 macrumors member Original poster Apr 11, 2008 66 0 May 2, 2008 #1 How do you save the position and size of the window in a Cocoa app so the window is the same after you close and open the program?
How do you save the position and size of the window in a Cocoa app so the window is the same after you close and open the program?
lee1210 macrumors 68040 Jan 10, 2005 3,182 3 Dallas, TX May 2, 2008 #2 http://developer.apple.com/document...dowPosition.html#//apple_ref/doc/uid/20000229 That ought to do it, if not the other topics in that guide should get you there. -Lee
http://developer.apple.com/document...dowPosition.html#//apple_ref/doc/uid/20000229 That ought to do it, if not the other topics in that guide should get you there. -Lee
J john903 macrumors member Original poster Apr 11, 2008 66 0 May 3, 2008 #3 Yes, I found that one but I don't understand how to obtain a pointer to an NSWindow. I'm new to Cocoa. Also, what method would I put this code in? Thanks for your help!
Yes, I found that one but I don't understand how to obtain a pointer to an NSWindow. I'm new to Cocoa. Also, what method would I put this code in? Thanks for your help!
Sayer macrumors 6502a Jan 4, 2002 981 0 Austin, TX May 3, 2008 #4 If the window is from a nib you can set a "Frame Name" in IB3's inspector (first panel) or auto save name in older IB I believe, and Cocoa will automatically save the size/position info to the preferences file when the window is closed.
If the window is from a nib you can set a "Frame Name" in IB3's inspector (first panel) or auto save name in older IB I believe, and Cocoa will automatically save the size/position info to the preferences file when the window is closed.
J john903 macrumors member Original poster Apr 11, 2008 66 0 May 3, 2008 #5 Thanks Sayer. That worked!