• 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: System Preference Pane Problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: System Preference Pane Problems


  • Subject: Re: System Preference Pane Problems
  • From: Dustin Voss <email@hidden>
  • Date: Fri, 30 May 2003 17:50:09 -0700

On Friday, May 30, 2003, at 11:43 AM, John Farmer wrote:

This is what my Create New Profile button does:

[NSApp beginSheet: createANewProfileWIndow
modalForWindow:[NSApp mainWindow]
modalDelegate:self
didEndSelector:NULL
contextInfo:NULL];

[NSApp runModalForWindow:createANewProfileWindow];
[NSApp endSheet: createANewProfileWindow];

And this is what my Cancel and Apply do in the window to close it:

[NSApp endSheet:createANewProfileWindow];
[createANewProfileWindow orderOut:self];
[NSApp stopModal];


I create my preference panel's About sheet like so:

- (void) openPanel
{
[NSApp beginSheet:panel modalForWindow:[NSApp mainWindow] modalDelegate:nil didEndSelector:nil contextInfo:nil];
}

I close it like so (connected to the "OK" button):

- (void)closePanel:(id)sender
{
[panel close];
[NSApp endSheet:panel];
}

This seems to work. Apple's documentation on how to make a sheet is incorrect. You don't need to call "runModalForWindow:" or "stopModal".

-- Dustin
_______________________________________________
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.

References: 
 >Re: System Preference Pane Problems (From: "John Farmer" <email@hidden>)

  • Prev by Date: A (hopefully) simple NSView problem.
  • Next by Date: NSImage help
  • Previous by thread: Re: System Preference Pane Problems
  • Next by thread: Compiler
  • Index(es):
    • Date
    • Thread