Hi all,

Got a weird one here, which has me slightly mystified.

I have a straightforward sheet containing a table and some buttons. First time 
I show it, it comes up fine and works as it should. All subsequent times, the 
whole interface is disabled except for the default button, so I can close it 
but I can't do anything in it. I'm not using bindings and the code is very 
straightforward:


// this is the method that shows the sheet:


- (void) beginAttributeEditSheetForParent:(NSWindow*) parentWindow 
withDelegate:(id) aDelegate
{
        [self setDelegate:aDelegate];
        
        [NSApp beginSheet:[self window]
           modalForWindow:parentWindow
            modalDelegate:self
           didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo:)
              contextInfo:NULL];
        
}

// this is the default button's action method:

- (IBAction)    closeAction:(id) sender
{
#pragma unused(sender)
        [NSApp endSheet:[self window] returnCode:NSOKButton];
}


// and this is the completion method:

- (void)        sheetDidEnd:(NSPanel*) sheet returnCode:(NSInteger) returnCode 
contextInfo:(void*) contextInfo
{
#pragma unused(returnCode, contextInfo)
        
        [self setDelegate:nil];
        [sheet orderOut:self];
}


// this is the caller which is in a subclass of NSDocument

- (IBAction)    editLayerAttributesAction:(id) sender
{
#pragma unused(sender)
        
        if( mAttrEditorController == nil )
                mAttrEditorController = [[DKOAttributeWindowController alloc] 
init];
        
        [mAttrEditorController beginAttributeEditSheetForParent:[self 
windowForSheet] withDelegate:self];
}


The controller is 'File's Owner' of the nib that contains the panel and is 
retained by the document. The nib name is supplied by the controller's 
-windowNibName method.

Other similar sheets work in exactly the same way and don't exhibit this 
problem. Any idea what's going on?

--Graham


_______________________________________________

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