nssplitview

How to animate the NSSplitView while resizing?

元气小坏坏 提交于 2019-12-05 07:36:26
问题 I would like to animate while resizing NSSplitView programatically. Here is the code for resizing the view in SplitView In awakeFromNib: Iam observing the NSSplitViewWillResizeSubviewsNotification [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(splitViewWillResizeSubviewsHandler:) name:NSSplitViewWillResizeSubviewsNotification object:splitView]; SplitView Resize NSView * leftSubView = [[splitView subviews] objectAtIndex:0]; if ([leftSubView isHidden]) { [leftSubView

How to toggle visibility of NSSplitView subView + hide Pane Splitter divider?

本小妞迷上赌 提交于 2019-12-05 04:55:06
We have a parent Split view ( NSSplitView ), and two subviews, Content and SideBar (the sidebar is on the right). What would be the optimal Cocoa-friendly way to toggle the SideBar view? I would really love it, if the suggested solution includes animation I really don't need any suggestions related to external plugins, etc (e.g. BWToolkit) HINT : I've been trying to do that, but still I had issues hiding the divider of the NSSplitView as well. How could I do it, while hiding it at the same time? Here's a pretty decent tutorial that shows how to do this: Unraveling the Mysteries of NSSplitView

Setting one side of an NSSplitView programmatically

≡放荡痞女 提交于 2019-12-04 22:13:12
问题 I've got an NSSplitView and on the left side I've got a tableView (like a source list) and depending on row selection, I want to change the the right side of the split view. I can't quite figure out how to do this. When I add my desired subview to the splitview, it adds another split (so now there's 3 views total... not what I wanted). [mySplitView addSubview:myCustomView]; How do I properly set the right side of my splitView? Update Using [mySplitView replaceSubview:[[mySplitView subviews]

Change views inside NSSplitViewController

房东的猫 提交于 2019-12-04 08:45:40
问题 I'm trying to migrate my Objective-C and now improving Swift knowledge to an application for Mac OS X. Steep learning curve! I'm trying to load a NSSplitViewController with different views in the "detail view" depending on buttons pressed on the "master view" if you will. Following tutorials and searching for hours has led me to nothing. I currently have: import Cocoa class MainSplitView: NSSplitViewController, BlissWindowDelegate { var masterViewController: vcMainMenu { let masterItem =

How to animate the NSSplitView while resizing?

不羁的心 提交于 2019-12-03 21:56:22
I would like to animate while resizing NSSplitView programatically. Here is the code for resizing the view in SplitView In awakeFromNib: Iam observing the NSSplitViewWillResizeSubviewsNotification [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(splitViewWillResizeSubviewsHandler:) name:NSSplitViewWillResizeSubviewsNotification object:splitView]; SplitView Resize NSView * leftSubView = [[splitView subviews] objectAtIndex:0]; if ([leftSubView isHidden]) { [leftSubView setHidden:NO]; [splitView setPosition:0 ofDividerAtIndex:0]; } else { [leftSubView setHidden:YES]; }

NSSplitViewController in OSX 10.10 using Xcode 6

会有一股神秘感。 提交于 2019-12-03 14:16:55
According to documentation on NSSplitViewControllers, the associated NSSplitView uses the NSSplitViewController as its delegate. Specifically in the documentation, "The split view controller serves as the delegate of its split view object (the object that manages the dividers). If you override a split view delegate method, your override must call super." I have implemented an NSSplitViewController in interface builder and gave it a class. However, none of the splitView delegates are ever invoked. Additionally, if I just do something like spit who the splitView delegate [ NSLog (@"%@", self

Change views inside NSSplitViewController

那年仲夏 提交于 2019-12-03 00:47:55
I'm trying to migrate my Objective-C and now improving Swift knowledge to an application for Mac OS X. Steep learning curve! I'm trying to load a NSSplitViewController with different views in the "detail view" depending on buttons pressed on the "master view" if you will. Following tutorials and searching for hours has led me to nothing. I currently have: import Cocoa class MainSplitView: NSSplitViewController, BlissWindowDelegate { var masterViewController: vcMainMenu { let masterItem = splitViewItems[0] as! NSSplitViewItem return masterItem.viewController as! vcMainMenu } override func

Make the divider of an NSSplitView undraggable and don't show the dragging cursor

为君一笑 提交于 2019-12-02 20:34:31
I have an NSSplitView ( NO UISplitView(Controller)!! ) with three subviews. Now, for the last divider (index 1 ), I want the divider to not show the dragging cursor (two arrows pointing out of eachother). I have this to stop the dragging, but the cursor is still showing up: - (CGFloat)splitView:(NSSplitView *)splitView constrainSplitPosition:(CGFloat)proposedPosition ofSubviewAt:(NSInteger)dividerIndex { if (dividerIndex == 1) { return [splitView frame].size.width - 161; } } Note that I only want to hide the cursor for the divider at index 1 . Can anyone help me? Thanks. :) No, I don't want to

NSSplitView and autolayout

末鹿安然 提交于 2019-12-02 20:29:28
How should I use auto layout constrains inside NSSplitView subview? My NSSplitView subview has 3 subview: topPane , tableContainer and bottomPane and I set the constrains like this: NSDictionary* views = NSDictionaryOfVariableBindings(topPane, tableContainer, bottomPane); for (NSView* view in [views allValues]) { [view setTranslatesAutoresizingMaskIntoConstraints:NO]; } [myView addConstraints:[NSLayoutConstraint constraintsWithVisualFormat:@"V:|[topPane(34)][tableContainer][bottomPane(24)]|" options:0 metrics:nil views:views]]; [mySplitView addSubview:myView]; And got this in console: Unable

Align NSToolbarItems with NSSplitView columns

旧城冷巷雨未停 提交于 2019-12-01 18:37:32
Finder and Notes have a peculiar behaviour that I am seeking to reproduce. The ‘flexible space’ in the NSToolbar seems to take the dimensions of the split view into account. For instance, the first group of buttons aligns on the left side with the right side of the sidebar. The second group of icons aligns with the right side of the first column. When I widen the sidebar, the toolbar items move along with it. Is it possible to reproduce this? Solution With the solution provided by @KenThomases, I have implemented this as follows: final class MainWindowController: NSWindowController { override