The menu position saving code has not worked for me for quite awhile. After being prodded by Alex I chased this bug down. Attached is a patch. Basically the problem is with this code:
return [NSString stringWithFormat: @"\033%@", [self title]]; //NSMenu.m ~155
On my machine this would return, for the Info menu, "nfo" not "\033Info", so the key was always nil (interestingly enough, if I manually edited the key in the defaults to be \033Info it worked properly). I changed this to:
return [NSString stringWithFormat: @"+%@", [self title]];
and the key was saved and read correctly.
I'm not sure if this is the proper fix, but it works here.
Cheers,
Michael
<nsmenu-bug.patch>
Index: NSMenu.m
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSMenu.m,v
retrieving revision 1.122
diff -u -r1.122 NSMenu.m
--- NSMenu.m 13 Sep 2003 13:38:46 -0000 1.122
+++ NSMenu.m 10 Jan 2004 08:07:10 -0000
@@ -146,7 +146,7 @@
{
if ([NSApp mainMenu] == self)
{
- return @"\033"; /* Root menu. */
+ return @"+"; /* Root menu. */
}
else
{
@@ -155,11 +155,11 @@
}
else if (_superMenu->_superMenu == nil)
{
- return [NSString stringWithFormat: @"\033%@", [self title]];
+ return [NSString stringWithFormat: @"+%@", [self title]];
}
else
{
- return [[_superMenu _locationKey] stringByAppendingFormat: @"\033%@",
+ return [[_superMenu _locationKey] stringByAppendingFormat: @"+%@",
[self title]];
}
}
_______________________________________________ Bug-gnustep mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-gnustep
