mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 09:51:23 +00:00
* Source/GSNibCompatibility.m: Fix for bug #24979. Change in
initWithCoder: for NSCustomView to return the real object directly and call nibInstantiate. Change to prevent double instantiation of NSApplication. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27186 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d114ff5bf8
commit
de22bc2880
2 changed files with 25 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2008-12-02 01:21-EST Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
|
* Source/GSNibCompatibility.m: Fix for bug #24979. Change in
|
||||||
|
initWithCoder: for NSCustomView to return the real object directly
|
||||||
|
and call nibInstantiate. Change to prevent double instantiation
|
||||||
|
of NSApplication.
|
||||||
|
|
||||||
2008-12-02 Gregory John Casamento <greg_casamento@yahoo.com>
|
2008-12-02 Gregory John Casamento <greg_casamento@yahoo.com>
|
||||||
|
|
||||||
* Source/NSSecureTextField.m: Added initWithCoder: method which
|
* Source/NSSecureTextField.m: Added initWithCoder: method which
|
||||||
|
|
|
@ -611,6 +611,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
||||||
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
|
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
|
||||||
|
ASSIGN(_object, [coder decodeObjectForKey: @"NSObject"]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -627,6 +628,7 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
[coder encodeObject: (id)_className forKey: @"NSClassName"];
|
[coder encodeObject: (id)_className forKey: @"NSClassName"];
|
||||||
[coder encodeConditionalObject: (id)_extension forKey: @"NSExtension"];
|
[coder encodeConditionalObject: (id)_extension forKey: @"NSExtension"];
|
||||||
|
[coder encodeConditionalObject: (id)_object forKey: @"NSObject"];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -657,8 +659,15 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
[NSException raise: NSInternalInconsistencyException
|
[NSException raise: NSInternalInconsistencyException
|
||||||
format: @"Unable to find class '%@'", _className];
|
format: @"Unable to find class '%@'", _className];
|
||||||
}
|
}
|
||||||
|
|
||||||
_object = [[aClass allocWithZone: NSDefaultMallocZone()] init];
|
if(GSObjCIsKindOf(aClass, [NSApplication class]))
|
||||||
|
{
|
||||||
|
_object = [aClass sharedApplication];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_object = [[aClass allocWithZone: NSDefaultMallocZone()] init];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return _object;
|
return _object;
|
||||||
}
|
}
|
||||||
|
@ -723,10 +732,10 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
_view = [[aClass allocWithZone: NSDefaultMallocZone()] initWithFrame: [self frame]];
|
_view = [[aClass allocWithZone: NSDefaultMallocZone()] initWithFrame: [self frame]];
|
||||||
[_view setAutoresizingMask: [self autoresizingMask]];
|
[_view setAutoresizingMask: [self autoresizingMask]];
|
||||||
[self setAutoresizesSubviews: [self autoresizesSubviews]];
|
[_view setAutoresizesSubviews: [self autoresizesSubviews]];
|
||||||
[self setHidden: [self isHidden]];
|
[_view setHidden: [self isHidden]];
|
||||||
[_view setNextResponder: [self nextResponder]];
|
[_view setNextResponder: [self nextResponder]];
|
||||||
[[self superview] replaceSubview: self with: _view]; // replace the old view...
|
// [[self superview] replaceSubview: self with: _view]; // replace the old view...
|
||||||
if (_rFlags.has_subviews)
|
if (_rFlags.has_subviews)
|
||||||
{
|
{
|
||||||
NSArray *subviews = [self subviews];
|
NSArray *subviews = [self subviews];
|
||||||
|
@ -753,6 +762,10 @@ static BOOL _isInInterfaceBuilder = NO;
|
||||||
{
|
{
|
||||||
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
ASSIGN(_className, [coder decodeObjectForKey: @"NSClassName"]);
|
||||||
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
|
ASSIGN(_extension, [coder decodeObjectForKey: @"NSExtension"]);
|
||||||
|
|
||||||
|
AUTORELEASE(self);
|
||||||
|
self = [self nibInstantiate];
|
||||||
|
RETAIN(self);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue