Re: Question about how Cocoa handles multiple occurences of the same window
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?
>From: Yann Bizeul <email@hidden>
>To: "K. Hoffmann" <email@hidden>
>CC: email@hidden
>Subject: Re: Question about how Cocoa handles multiple occurences of the
same window
>Date: Tue, 20 Jul 2004 22:47:25 +0200
>
>Hi,
>
>You should maintain a NSArray of your NSWindowController subclasses,
>in which you store path to the sound file.
>Each time the use hits OK, a new ProgressController (subclass of
>NSWindowController) would be instantiated, the added to your
>NSArray. Then you can manage everything in ProgressController
>
>Am I clear ?
>
>Le 20 juil. 04, ` 22:26, K. Hoffmann a icrit :
>
>>I'm working on an application and have a question about how Cocoa
>>handles/references multiple occurences of the same window/nib.
>>
>>In the app, the user sets a bunch of parameters to generate a sound
>>file, then hits execute. An auxillary window is loaded called
>>ProgressWindow which shows text updates about how far along the
>>generation is. Once it's done, buttons on the ProgressWindow allow
>>the user to quickly preview the sound and delete it if they don't
>>like it.
>>
>>The problem I had was storing the path of the generated sound,
>>since the user could generate a sound, leave the progress window
>>open, generate two others (which would open two more progress
>>windows), then go back and try to preview the first one. Its path
>>would be gone. The idea I had was to subclass NSWindow, then store
>>the path of the soundfile to be generated as a variable in the
>>subclassed progress window.
>>
>>The problem is in the method that opens the progress window.
>>There's a call there to set the path of the generated soundfile in
>>the window via [[progressController window] setPath:blah], with
>>progressController being a NSWindowController. Unfortunately, this
>>call sets the path of every open progress window to blah. Since
>>there's only one global instance of progressController, and one
>>outlet to progressWindow, will any call to them automatically
>>reference every progress window that's open?
>>
>>_________________________________________________________________
>>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.
>>
>>
>>
>--
>Yann Bizeul - yann at tynsoe.org
>
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.