[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnustep-gui] [NSMenuItem setKeyEquivalent:] nil value
From: |
Blake Nicholson |
Subject: |
[gnustep-gui] [NSMenuItem setKeyEquivalent:] nil value |
Date: |
Sat, 17 May 2008 13:43:14 -0400 |
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-gui] [NSMenuItem setKeyEquivalent:] nil value,
Blake Nicholson <=