• 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: Validating Input from Sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Validating Input from Sheet


  • Subject: Re: Validating Input from Sheet
  • From: Hasan Diwan <email@hidden>
  • Date: Fri, 10 Jan 2003 12:58:20 -0800

[NSApp beginSheet:window modalForWindow:[NSApp keyWindow]
modalDelegate:self
didEndSelector:@selector(sheetDidEnd:returnCode:contextInfo)
contextInfo:nil];
...
- (void)sheetDidEnd:(NSWindow *)w returnCode:(int)rc contextInfo:(void
*)n {
if ([[[window textField] stringValue] isEqualToString:@""]) {
NSRunCriticalAlertPanel(NSLocalizedString(@"sheetFailedTitle",
@"sheet has failed") NSLocalizedString(@"sheetFailedMessage", @"foo bar
baz"), NSLocalizedString(@"Ok", @"Ok"), nil, nil);
[NSApp terminate:nil];
}
string = [[window textField] stringValue];
}
Hope that helps!
On Friday, January 10, 2003, at 07:44 AM, Jeff LaMarche wrote:

> I've got a sheet that I use to get information from the user. When
> they hit okay, I want to do some validation. When an error condition
> is found, I'm currently doing another sheet, but this somehow feels...
> dirty. Is there a better way, or is it okay to do a
> sheet-within-a-sheet for validation?
Hasan Diwan
OpenPGP KeyID: 0x7EE3855B
Fingerprint: 42F0 5758 C3EB BA1F ABD2 ED49 3390 CCF0 7EE3 855B
http://www.cs.rpi.edu/~diwanh/gpg.key

[demime 0.98b removed an attachment of type application/pgp-signature which had a name of PGP.sig]
_______________________________________________
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: 
 >Validating Input from Sheet (From: Jeff LaMarche <email@hidden>)

  • Prev by Date: Re: Aqua Human Interface and Safari
  • Next by Date: Re: NSMovie/NSMovieView problem
  • Previous by thread: Validating Input from Sheet
  • Next by thread: Re: cocoa-dev digest, Vol 2 #1769 - 12 msgs
  • Index(es):
    • Date
    • Thread