modal window - enable paste, quit
modal window - enable paste, quit
- Subject: modal window - enable paste, quit
- From: Rick Adams <email@hidden>
- Date: Tue, 20 Jan 2004 16:36:20 -0500
Howdy,
I have a NSWindow (licenseWindow) with a single NSTextField
(licenseCode) and an NSButton.
I want the user to be able to paste their license code into the text
field, but of course since the window is application modal the paste
menu item isn't available. I saw in the archives some messages about
this and know I have to use worksWhenModal somewhere - but I don't
seem to be able to replicate their success.
Is there sample code that does this type of thing somewhere?
while ([self checkLicense] > 0){
[licenseCode setStringValue:[dict objectForKey:@"LicenseCode"]];
[NSApp runModalForWindow:licenseWindow];
}
- (IBAction)licenseUpdate:(id)sender
{
BOOL retBool;
[dict setObject:[licenseCode stringValue]forKey:@"LicenseCode"];
retBool = [dict writeToFile:[[NSBundle mainBundle]
pathForResource:@"InfoPlist" ofType:@"strings"] atomically:YES];
[NSApp stopModal];
[licenseWindow orderOut:self];
}
_______________________________________________
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.