gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnustep-gui] [NSMenuItem setKeyEquivalent:] nil value


From: Fred Kiefer
Subject: Re: [gnustep-gui] [NSMenuItem setKeyEquivalent:] nil value
Date: Wed, 28 May 2008 10:26:56 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

Done.

Blake Nicholson wrote:
I just wanted to bring something to the attention of any gnustep-gui folks out there. On Mac OS X, nil should never be passed as a key equivalent. To define no key equivalent, one should pass an empty string. The code for [NSMenuItem setKeyEquivalent:] in gnustep-gui checks for (and corrects) a nil key equivalent, but for portability it might be nice to include an NSWarnLog or some sort of output to make a developer aware that the use of nil for a key equivalent is not portable.


Blake


Here is the current implementation of [NSMenuItem setKeyEquivalent:] from gnustep-gui:

- (void) setKeyEquivalent: (NSString*)aKeyEquivalent
{
  if (nil == aKeyEquivalent)
    aKeyEquivalent = @"";

  ASSIGNCOPY(_keyEquivalent,  aKeyEquivalent);
  [_menu itemChanged: self];
}




_______________________________________________
Gnustep-dev mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/gnustep-dev






reply via email to

[Prev in Thread] Current Thread [Next in Thread]