* Source/NSTabView.m (-dealloc): Reset _selected to nil at top of

dealloc.
* Source/NSBox.m(-drawRect:, -initWithCoder:): Implement
transparent handling for custom boxes.
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>

* Source/NSTabView.m (-selectTabViewItem:): Remove duplicated
code.
* Source/NSTabView.m (-removeTabViewItem:): Retain the item
while removing it.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35773 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
fredkiefer 2012-11-01 00:06:46 +00:00
parent 1a9eba9fa5
commit e04be1c03e
3 changed files with 33 additions and 19 deletions

View file

@ -1,3 +1,13 @@
2012-10-31 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSTabView.m (-dealloc): Reset _selected to nil at top of dealloc.
* Source/NSBox.m(-drawRect:, -initWithCoder:): Implement
transparent handling for custom boxes.
Patch by Marcian Lytwyn <marcian.lytwyn@advcsi.com>
* Source/NSTabView.m (-selectTabViewItem:): Remove duplicated code.
* Source/NSTabView.m (-removeTabViewItem:): Retain the item while
removing it.
2012-10-26 German A. Arias <german@xelalug.org>
* Source/GSThemeMenu.m (-setMenu:forWindow:): Revert last change. After

View file

@ -456,9 +456,16 @@
rect = NSIntersectionRect(_bounds, rect);
if (_box_type == NSBoxCustom)
{
if (_transparent)
{
color = [NSColor clearColor];
}
else
{
color = _fill_color;
}
}
else
{
color = [_window backgroundColor];
@ -582,7 +589,7 @@
[aCoder encodeInt: [self borderType] forKey: @"NSBorderType"];
[aCoder encodeInt: [self boxType] forKey: @"NSBoxType"];
[aCoder encodeInt: [self titlePosition] forKey: @"NSTitlePosition"];
[aCoder encodeBool: _transparent forKey: @"NSTransparent"];
[aCoder encodeBool: _transparent forKey: @"NSFullyTransparent"];
[aCoder encodeSize: [self contentViewMargins] forKey: @"NSOffsets"];
}
else
@ -623,8 +630,13 @@
}
if ([aDecoder containsValueForKey: @"NSTransparent"])
{
// On Apple this is always NO, we keep it for old GNUstep archives
_transparent = [aDecoder decodeBoolForKey: @"NSTransparent"];
}
if ([aDecoder containsValueForKey: @"NSFullyTransparent"])
{
_transparent = [aDecoder decodeBoolForKey: @"NSFullyTransparent"];
}
if ([aDecoder containsValueForKey: @"NSOffsets"])
{
[self setContentViewMargins: [aDecoder decodeSizeForKey: @"NSOffsets"]];

View file

@ -86,11 +86,11 @@
- (void) dealloc
{
RELEASE(_items);
RELEASE(_font);
// Reset the _selected attribute to prevent crash when -dealloc calls
// -setNextKeyView:
_selected = nil;
RELEASE(_items);
RELEASE(_font);
[super dealloc];
}
@ -139,6 +139,7 @@
if (i == NSNotFound)
return;
RETAIN(tabViewItem);
// Do this BEFORE removing from array...in case it gets released...
[tabViewItem _setTabView: nil];
[_items removeObjectAtIndex: i];
@ -156,6 +157,7 @@
[self selectTabViewItem: [_items objectAtIndex: newIndex]];
}
}
RELEASE(tabViewItem);
if ([_delegate respondsToSelector: @selector(tabViewDidChangeNumberOfTabViewItems:)])
{
@ -256,21 +258,11 @@
/* NB: If [_selected view] is nil this does nothing, which
is fine. */
[[_selected view] removeFromSuperview];
_selected = nil;
}
if ([_delegate respondsToSelector:
@selector(tabView: willSelectTabViewItem:)])
{
[_delegate tabView: self willSelectTabViewItem: tabViewItem];
}
_selected = tabViewItem;
_selected_item = [_items indexOfObject: _selected];
[_selected _setTabState: NSSelectedTab];
selectedView = [_selected view];
if (selectedView != nil)
{
NSView *firstResponder;