• 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
modal window - enable paste, quit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: Localization question
  • Next by Date: Re: How to get hard drive name
  • Previous by thread: Re: How to get hard drive name
  • Next by thread: Re: *****SPAM*****How to convince company I should switch to Cocoa
  • Index(es):
    • Date
    • Thread