FROM : Michael Heinz
DATE : Wed Dec 15 20:41:20 2004
On Wednesday, December 15, 2004, at 01:09PM, j o a r <<email_removed>> wrote:
>What you could do is to store the "default window size" in
>NSUserDefaults every time one of your document windows changes size,
>and then make sure to size new windows accordingly before they are
>brought on screen.
>
Joar,
I've actually asked questions about that several times on this list and I never got a reply- I'm already using "auto save name" feature of the nib, and it the user defaults load correctly when the first document is loaded at application start up. The problem is that all later windows just get the original settings from the nib. If that worked "as expected" I wouldn't be trying to do it by hand.
>You say that "there doesn't seem to be any get/set size functionality
>at all". I assume that you mean that you don't mean in NSWindow (as it
>obviously has that functionality), but rather that you can't find it in
>the convenience classes of a document based application?
That was the first problem - while I found the method for taking a NSWindow pointer and getting the matching document, there doesn't seem to be a way to go from an NSDocument to the corresponding NSWindow. Fortunately, I was able to extract that information from a custom view that's already in the application.
DATE : Wed Dec 15 20:41:20 2004
On Wednesday, December 15, 2004, at 01:09PM, j o a r <<email_removed>> wrote:
>What you could do is to store the "default window size" in
>NSUserDefaults every time one of your document windows changes size,
>and then make sure to size new windows accordingly before they are
>brought on screen.
>
Joar,
I've actually asked questions about that several times on this list and I never got a reply- I'm already using "auto save name" feature of the nib, and it the user defaults load correctly when the first document is loaded at application start up. The problem is that all later windows just get the original settings from the nib. If that worked "as expected" I wouldn't be trying to do it by hand.
>You say that "there doesn't seem to be any get/set size functionality
>at all". I assume that you mean that you don't mean in NSWindow (as it
>obviously has that functionality), but rather that you can't find it in
>the convenience classes of a document based application?
That was the first problem - while I found the method for taking a NSWindow pointer and getting the matching document, there doesn't seem to be a way to go from an NSDocument to the corresponding NSWindow. Fortunately, I was able to extract that information from a custom view that's already in the application.
| Related mails | Author | Date |
|---|---|---|
| Michael Heinz | Dec 15, 18:57 | |
| Stephane Sudre | Dec 15, 19:06 | |
| j o a r | Dec 15, 19:09 | |
| Jeff LaMarche | Dec 15, 19:15 | |
| Michael Heinz | Dec 15, 20:41 | |
| Michael Heinz | Dec 15, 20:42 | |
| Michael Heinz | Dec 15, 20:44 | |
| Milton Sagen | Dec 15, 20:56 | |
| Michael Heinz | Dec 15, 21:19 | |
| Henry McGilton | Dec 16, 04:24 | |
| Tim Lucas | Dec 16, 04:50 |






Cocoa mail archive

