mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-03 17:30:42 +00:00
Make sure a decoded control always has a cell.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27122 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
cdfd0abd9f
commit
4beecc0c17
2 changed files with 19 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2008-11-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||||
|
|
||||||
|
* Source/NSControl.m (-initWithCoder:): For keyed decoding make
|
||||||
|
sure there always is a cell.
|
||||||
|
|
||||||
2008-11-23 Wolfgang Lux <wolfgang.lux@gmail.com>
|
2008-11-23 Wolfgang Lux <wolfgang.lux@gmail.com>
|
||||||
|
|
||||||
* Source/NSTextView.m (-mouseDown:): Allow click into the current
|
* Source/NSTextView.m (-mouseDown:): Allow click into the current
|
||||||
|
|
|
@ -971,7 +971,11 @@ static NSNotificationCenter *nc;
|
||||||
|
|
||||||
- (id) initWithCoder: (NSCoder*)aDecoder
|
- (id) initWithCoder: (NSCoder*)aDecoder
|
||||||
{
|
{
|
||||||
[super initWithCoder: aDecoder];
|
self = [super initWithCoder: aDecoder];
|
||||||
|
if (self == nil)
|
||||||
|
{
|
||||||
|
return nil;
|
||||||
|
}
|
||||||
|
|
||||||
if ([aDecoder allowsKeyedCoding])
|
if ([aDecoder allowsKeyedCoding])
|
||||||
{
|
{
|
||||||
|
@ -981,6 +985,15 @@ static NSNotificationCenter *nc;
|
||||||
{
|
{
|
||||||
[self setCell: cell];
|
[self setCell: cell];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// This is needed for subclasses without cells, like NSColorWeel
|
||||||
|
// as we store some properties only on the cell.
|
||||||
|
NSCell *cell = [[[self class] cellClass] new];
|
||||||
|
|
||||||
|
[self setCell: cell];
|
||||||
|
RELEASE(cell);
|
||||||
|
}
|
||||||
if ([aDecoder containsValueForKey: @"NSEnabled"])
|
if ([aDecoder containsValueForKey: @"NSEnabled"])
|
||||||
{
|
{
|
||||||
[self setEnabled: [aDecoder decodeBoolForKey: @"NSEnabled"]];
|
[self setEnabled: [aDecoder decodeBoolForKey: @"NSEnabled"]];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue