From 4e6790ebf67cda4ea31ec077d78c45ac6aed1008 Mon Sep 17 00:00:00 2001 From: nico Date: Wed, 30 Aug 2000 17:48:30 +0000 Subject: [PATCH] Changes to make inheriting decoding simpler git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@7294 72102866-910b-0410-8b05-ffd578937521 --- Source/NSForm.m | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/Source/NSForm.m b/Source/NSForm.m index 91c2eaddd..049b141f8 100644 --- a/Source/NSForm.m +++ b/Source/NSForm.m @@ -100,15 +100,7 @@ static Class defaultCellClass = nil; [self insertRow:index]; [self putCell:new_cell atRow:index column:0]; - [new_cell release]; - - [self setValidateSize: YES]; - - [[NSNotificationCenter defaultCenter] - addObserver: self - selector: @selector(_setTitleWidthNeedsUpdate:) - name: _NSFormCellDidChangeTitleWidthNotification - object: new_cell]; + RELEASE (new_cell); return new_cell; } @@ -123,6 +115,26 @@ static Class defaultCellClass = nil; [self removeRow:index]; } +/* Overriding this method allows decoding stuff to be inherited + simpler by NSForm */ +- (void) putCell: (NSCell*)newCell atRow: (int)row column: (int)column +{ + if (column > 0) + { + NSLog (@"Warning: NSForm: tried to add a cell in a column > 0"); + return; + } + [super putCell: newCell atRow: row column: column]; + + [self setValidateSize: YES]; + + [[NSNotificationCenter defaultCenter] + addObserver: self + selector: @selector(_setTitleWidthNeedsUpdate:) + name: _NSFormCellDidChangeTitleWidthNotification + object: newCell]; +} + - (void)dealloc { [[NSNotificationCenter defaultCenter]