From 8c43a032dba78bb661432b95e7326853791ccf0b Mon Sep 17 00:00:00 2001 From: richard Date: Tue, 7 Dec 1999 05:34:07 +0000 Subject: [PATCH] Fixes from Jonathon Gapen git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5388 72102866-910b-0410-8b05-ffd578937521 --- Source/NSButton.m | 10 +++++++--- Source/NSPopUpButton.m | 16 +++++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/Source/NSButton.m b/Source/NSButton.m index d7ce1c188..43649408a 100644 --- a/Source/NSButton.m +++ b/Source/NSButton.m @@ -75,17 +75,21 @@ id _nsbuttonCellClass = nil; // // Initialization // -- init +- (id) init { return [self initWithFrame: NSZeroRect]; } -- initWithFrame: (NSRect)frameRect +- (id) initWithFrame: (NSRect)frameRect { + NSCell *aCell; + [super initWithFrame: frameRect]; // set our cell - [self setCell: [[_nsbuttonCellClass new] autorelease]]; + aCell = [[[self class] cellClass] new]; + [self setCell: aCell]; + RELEASE(aCell); return self; } diff --git a/Source/NSPopUpButton.m b/Source/NSPopUpButton.m index 00107768f..0d2f80b4c 100644 --- a/Source/NSPopUpButton.m +++ b/Source/NSPopUpButton.m @@ -40,7 +40,7 @@ // // class variables // -id _nspopupbuttonCellClass = nil; +Class _nspopupbuttonCellClass = 0; // // NSPopUpButton implementation @@ -61,7 +61,17 @@ id _nspopupbuttonCellClass = nil; [self setCellClass: [NSPopUpButtonCell class]]; } } - + ++ (Class) cellClass +{ + return _nspopupbuttonCellClass; +} + ++ (void) setCellClass: (Class)classId +{ + _nspopupbuttonCellClass = classId; +} + // // Initializing an NSPopUpButton // @@ -135,7 +145,7 @@ id _nspopupbuttonCellClass = nil; } - (void) insertItemWithTitle: (NSString *)title - atIndex: (int)index + atIndex: (int)index { [cell insertItemWithTitle: title adIndex: index];