• 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: Question about how Cocoa handles multiple occurences of the same window
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question about how Cocoa handles multiple occurences of the same window


  • Subject: Re: Question about how Cocoa handles multiple occurences of the same window
  • From: "K. Hoffmann" <email@hidden>
  • Date: Fri, 23 Jul 2004 03:10:02 -0400

This doesn't seem to be working. I subclassed NSWindowController and added the code about setting paths and such there. Then, I added an NSMutableArray. Everytime the method that opens a progress window is loaded, I generate a new ProgressController (the new subclass) and init it with initWithWindow:progressWindow, then add it to the array. progressWindow is an IBOutlet to the window that needs to be loaded. I then retrieve the path, using NSWindow's windowController method to get the window's controller.

In the end, the problem is the same: each call to set a path ends up setting every progress window's save path to be the exact same. Does NSWindowController's initWithWindow method simply override any previous window controllers that might have had control of a window?


&gt;From: Yann Bizeul &lt;email@hidden&gt;
&gt;To: &quot;K. Hoffmann&quot; &lt;email@hidden&gt;
&gt;CC: email@hidden
&gt;Subject: Re: Question about how Cocoa handles multiple occurences of the same window
&gt;Date: Tue, 20 Jul 2004 22:47:25 +0200
&gt;
&gt;Hi,
&gt;
&gt;You should maintain a NSArray of your NSWindowController subclasses,
&gt;in which you store path to the sound file.
&gt;Each time the use hits OK, a new ProgressController (subclass of
&gt;NSWindowController) would be instantiated, the added to your
&gt;NSArray. Then you can manage everything in ProgressController
&gt;
&gt;Am I clear ?
&gt;
&gt;Le 20 juil. 04, ` 22:26, K. Hoffmann a icrit :
&gt;
&gt;&gt;I'm working on an application and have a question about how Cocoa
&gt;&gt;handles/references multiple occurences of the same window/nib.
&gt;&gt;
&gt;&gt;In the app, the user sets a bunch of parameters to generate a sound
&gt;&gt;file, then hits execute. An auxillary window is loaded called
&gt;&gt;ProgressWindow which shows text updates about how far along the
&gt;&gt;generation is. Once it's done, buttons on the ProgressWindow allow
&gt;&gt;the user to quickly preview the sound and delete it if they don't
&gt;&gt;like it.
&gt;&gt;
&gt;&gt;The problem I had was storing the path of the generated sound,
&gt;&gt;since the user could generate a sound, leave the progress window
&gt;&gt;open, generate two others (which would open two more progress
&gt;&gt;windows), then go back and try to preview the first one. Its path
&gt;&gt;would be gone. The idea I had was to subclass NSWindow, then store
&gt;&gt;the path of the soundfile to be generated as a variable in the
&gt;&gt;subclassed progress window.
&gt;&gt;
&gt;&gt;The problem is in the method that opens the progress window.
&gt;&gt;There's a call there to set the path of the generated soundfile in
&gt;&gt;the window via [[progressController window] setPath:blah], with
&gt;&gt;progressController being a NSWindowController. Unfortunately, this
&gt;&gt;call sets the path of every open progress window to blah. Since
&gt;&gt;there's only one global instance of progressController, and one
&gt;&gt;outlet to progressWindow, will any call to them automatically
&gt;&gt;reference every progress window that's open?
&gt;&gt;
&gt;&gt;_________________________________________________________________
&gt;&gt;Dont just search. Find. Check out the new MSN Search!
&gt;&gt;http://search.msn.click-url.com/go/onm00200636ave/direct/01/
&gt;&gt;_______________________________________________
&gt;&gt;cocoa-dev mailing list | email@hidden
&gt;&gt;Help/Unsubscribe/Archives:
&gt;&gt;http://www.lists.apple.com/mailman/listinfo/cocoa-dev
&gt;&gt;Do not post admin requests to the list. They will be ignored.
&gt;&gt;
&gt;&gt;
&gt;&gt;
&gt;--
&gt;Yann Bizeul - yann at tynsoe.org
&gt;http://projects.tynsoe.org/

_________________________________________________________________
Dont just search. Find. Check out the new MSN Search! http://search.msn.click-url.com/go/onm00200636ave/direct/01/
_______________________________________________
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.


  • Prev by Date: Re: July ADC Mailing
  • Next by Date: Re: NSTimer firing issue
  • Previous by thread: Re: Question about how Cocoa handles multiple occurences of the same window
  • Next by thread: Sending image from separate thread back to AppController
  • Index(es):
    • Date
    • Thread