• 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: Preventing textfield in table from clicking default button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Preventing textfield in table from clicking default button


  • Subject: Re: Preventing textfield in table from clicking default button
  • From: Seth Willits <email@hidden>
  • Date: Sat, 16 Aug 2014 19:57:50 -0700

On Aug 16, 2014, at 7:53 PM, Seth Willits <email@hidden> wrote:

> This is leaving me little choice but to do something very specialized and ugly.

Well… the simplest solution is to just disable the key equivalent myself instead of using NSWindow's methods. I don't like it, but it does work in my case...


- (void)textDidBeginEditing:(NSNotification *)notification;
{
	self.window.defaultButtonCell.keyEquivalent = @"";
	[super textDidBeginEditing:notification];
}


- (void)textDidEndEditing:(NSNotification *)notification;
{
	[super textDidEndEditing:notification];
	self.window.defaultButtonCell.keyEquivalent = @"\r";
}



--
Seth Willits




_______________________________________________

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


References: 
 >Preventing textfield in table from clicking default button (From: Seth Willits <email@hidden>)

  • Prev by Date: Preventing textfield in table from clicking default button
  • Next by Date: Re: Preventing textfield in table from clicking default button
  • Previous by thread: Preventing textfield in table from clicking default button
  • Next by thread: Re: Preventing textfield in table from clicking default button
  • Index(es):
    • Date
    • Thread