• 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: Reloading a window from NIB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Reloading a window from NIB


  • Subject: Re: Reloading a window from NIB
  • From: Sergey Shapovalov <email@hidden>
  • Date: Mon, 12 Mar 2007 10:30:23 +0300

Hello Matt!

Thank you very much for your reply.

To implement this behavior of the "New" command, I'd like to be able
to reload the window in its original state as it is stored in the NIB. My
question is as simple as: how can I do it?



Two obvious ways:

(1) When the user says to restore the original state of the window, you just
restore it, in code. You presumably know what the original state is, and
you're not allowing the user to change the original state, so this should be
trivial. Just tell all the things in the window what their state should be.


Yes, that was the first thing that came to my mind. However, it looks
like in my case it's not that simple. Too many parameters to restore:
window position and size, state of all splitters, views and controls.
Besides, some of controls in my window are created dynamically
on the fly, and I don't want to see them after I say "New" - I want to
revert to the original state. That all made me think about reloading
the window from NIB.

Or....

(2) Use a secondary nib containing the window, and "release when closed".
Load the nib to obtain the window. When the window closes, the window is
released. Load the nib again to obtain a fresh copy of the window. You might
find communication between nibs easier if you use an NSWindowController for
this. In that case, implement singleton on the NSWindowController and
release it when the window closes. m.


Yes, that's what I was planning to do. My question was: how can this
be done? Sorry if I'm asking trivial questions, I don't have much experience
with Cocoa. A short sample demonstrating how to load a window from
NIB would help me much!


Best regards,
Sergey.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Reloading a window from NIB
      • From: Mark Ritchie <email@hidden>
    • Re: Reloading a window from NIB
      • From: Dominik Pich <email@hidden>
References: 
 >Re: Reloading a window from NIB (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Coredata performance problem : massive insertion produces error in allocate region
  • Next by Date: Terminal Framework?
  • Previous by thread: Re: Reloading a window from NIB
  • Next by thread: Re: Reloading a window from NIB
  • Index(es):
    • Date
    • Thread