Hi, All,

I have a project where a progress of NSTask is indicated through this code:

        if ([self  popup] != nil)
                anObj = [self popup];
        else
                anObj = self;
    [[NSNotificationCenter defaultCenter] addObserver:anObj
                                                                                
         selector:@selector(getData:)
                                                                                
                 name:NSFileHandleReadCompletionNotification
                                                                                
           object:[[mytask standardError] fileHandleForReading]];
    [[NSNotificationCenter defaultCenter] addObserver:anObj
                                                                                
         selector:@selector(taskTerminated:)
                                                                                
                 name:NSTaskDidTerminateNotification
                                                                                
           object:mytask];
[[[mytask standardError] fileHandleForReading] readInBackgroundAndNotify];


All is going OK when I have a progress bar in the main window, so anObj = self. But I'd like to use just the same code to show a progress of the same NSTask by a NSProgressIndicator, placed in a modal NSPanel, opened through [NSApp runModalForWindow:]. In this case NSTask is launched and is executed OK, And it does what it should. But none of notifications are going to my popup modal window.At least getData method is never called, as debugger shows it.

self is AppController, popup is a subclass of NSWindowController.

What is the problem reason? Is it possible to receive notifications in a modal window?

Thanks.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to