mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 07:00:46 +00:00
Set frame of the new selected view before adding it
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@12802 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3aba6cfd6d
commit
1219f28358
1 changed files with 16 additions and 8 deletions
|
@ -177,12 +177,16 @@
|
|||
|
||||
if (canSelect)
|
||||
{
|
||||
if (_selected)
|
||||
NSView *selectedView;
|
||||
|
||||
if (_selected != nil)
|
||||
{
|
||||
[_selected _setTabState: NSBackgroundTab];
|
||||
if ([_selected view])
|
||||
[[_selected view] removeFromSuperview];
|
||||
}
|
||||
|
||||
/* NB: If [_selected view] is nil this does nothing, which
|
||||
is fine. */
|
||||
[[_selected view] removeFromSuperview];
|
||||
}
|
||||
|
||||
_selected = tabViewItem;
|
||||
|
||||
|
@ -195,14 +199,18 @@
|
|||
_selected_item = [_items indexOfObject: _selected];
|
||||
[_selected _setTabState: NSSelectedTab];
|
||||
|
||||
if ([_selected view])
|
||||
selectedView = [_selected view];
|
||||
|
||||
if (selectedView != nil)
|
||||
{
|
||||
[self addSubview: [_selected view]];
|
||||
[self addSubview: selectedView];
|
||||
[selectedView setFrame: [self contentRect]];
|
||||
[_window makeFirstResponder: [_selected initialFirstResponder]];
|
||||
}
|
||||
|
||||
|
||||
/* FIXME - only mark the contentRect as needing redisplay! */
|
||||
[self setNeedsDisplay: YES];
|
||||
|
||||
|
||||
if ([_delegate respondsToSelector:
|
||||
@selector(tabView: didSelectTabViewItem:)])
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue