• 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: Programatically resizing a window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Programatically resizing a window


  • Subject: Re: Programatically resizing a window
  • From: j o a r <email@hidden>
  • Date: Wed, 15 Dec 2004 19:09:52 +0100


On 2004-12-15, at 18.57, Michael Heinz wrote:

Okay, I've googled for this and checked my books to no avail - I have a document based app where the user is likely to open multiple documents, one at a time. I'd like each successive document window to open with the same size as its predecessor - but I can't figure out how to do it. There doesn't seem to be any get/set size functionality at all and all the tutorials talk about is setting the size in the nib file.

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.


Another thing to look at might be the functionality built into NSWindow for storing / restoring a window frame (see the "xxxFrameUsingName" methods), although it's perhaps more tailored for singleton windows.

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?
I think that you should look into adding this custom logic to your window controller subclass. If you don't have a custom window controller subclass, you might want to add it to the "windowControllerDidLoadNib" method of your NSDocument subclass, or something similar.


j o a r

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Programatically resizing a window
      • From: Michael Heinz <email@hidden>
References: 
 >Programatically resizing a window (From: Michael Heinz <email@hidden>)

  • Prev by Date: Re: Programatically resizing a window
  • Next by Date: Re: Programatically resizing a window
  • Previous by thread: Re: Programatically resizing a window
  • Next by thread: Re: Programatically resizing a window
  • Index(es):
    • Date
    • Thread