mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 17:52:42 +00:00
Add viewcontroller to item
This commit is contained in:
parent
2bd3faf3c8
commit
577aefb437
3 changed files with 10 additions and 0 deletions
|
@ -104,6 +104,7 @@ typedef NSInteger NSTitlebarSeparatorStyle;
|
|||
- (void) setTitlebarSeparatorStyle: (NSTitlebarSeparatorStyle)style;
|
||||
|
||||
- (NSViewController *) viewController;
|
||||
- (void) setViewController: (NSViewController *)vc;
|
||||
@end
|
||||
|
||||
APPKIT_EXPORT const CGFloat NSSplitViewItemUnspecifiedDimension;
|
||||
|
|
|
@ -146,6 +146,11 @@
|
|||
return _viewController;
|
||||
}
|
||||
|
||||
- (void) setViewController: (NSViewController *)vc
|
||||
{
|
||||
_viewController = vc;
|
||||
}
|
||||
|
||||
// NSCoding
|
||||
- (instancetype) initWithCoder: (NSCoder *)coder
|
||||
{
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
#import "AppKit/NSWindowController.h"
|
||||
#import "AppKit/NSViewController.h"
|
||||
#import "AppKit/NSSplitViewController.h"
|
||||
#import "AppKit/NSSplitViewItem.h"
|
||||
#import "AppKit/NSSplitView.h"
|
||||
#import "AppKit/NSWindow.h"
|
||||
#import "AppKit/NSApplication.h"
|
||||
|
@ -125,6 +126,9 @@
|
|||
NSSplitViewController *svc = (NSSplitViewController *)_sourceController;
|
||||
[[svc splitView] adjustSubviews];
|
||||
[[svc splitView] addSubview: v];
|
||||
NSUInteger idx = [[[svc splitView] subviews] count] - 1;
|
||||
NSSplitViewItem *item = [[svc splitViewItems] objectAtIndex: idx];
|
||||
[item setViewController: _destinationController];
|
||||
}
|
||||
}
|
||||
else if ([_kind isEqualToString: @"modal"])
|
||||
|
|
Loading…
Reference in a new issue