• 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
Sheet comes up disabled on second showing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Sheet comes up disabled on second showing


  • Subject: Sheet comes up disabled on second showing
  • From: Graham Cox <email@hidden>
  • Date: Fri, 27 Nov 2009 12:32:44 +1100

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 (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • [SOLVED] Re: Sheet comes up disabled on second showing
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: My try/catch block isn't catching exceptions on 10.6
  • Next by Date: Core Data - any way to back it with something other than SQLite 3?
  • Previous by thread: Re: My try/catch block isn't catching exceptions on 10.6
  • Next by thread: [SOLVED] Re: Sheet comes up disabled on second showing
  • Index(es):
    • Date
    • Thread