Encode item and title of menu, so that it will show in the nib.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@23206 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Gregory John Casamento 2006-08-05 13:08:53 +00:00
parent fb8609cf7a
commit 3db08e83f6
2 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2006-08-05 09:08-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Source/NSMenu.m: encodeWithCoder: encode items and title of
menu.
2006-08-05 08:43-EDT Gregory John Casamento <greg_casamento@yahoo.com>
* Headers/Additions/GNUstepGUI/GSNibCompatibility.h

View file

@ -1213,9 +1213,17 @@ static NSNotificationCenter *nc;
*/
- (void) encodeWithCoder: (NSCoder*)encoder
{
[encoder encodeObject: _title];
[encoder encodeObject: _items];
[encoder encodeValueOfObjCType: @encode(BOOL) at: &_autoenable];
if([encoder allowsKeyedCoding])
{
[encoder encodeObject: _title forKey: @"NSTitle"];
[encoder encodeObject: _items forKey: @"NSMenuItems"];
}
else
{
[encoder encodeObject: _title];
[encoder encodeObject: _items];
[encoder encodeValueOfObjCType: @encode(BOOL) at: &_autoenable];
}
}
- (id) initWithCoder: (NSCoder*)aDecoder