nssplitview

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

独自空忆成欢 提交于 2019-12-22 04:48:08
问题 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

NSSplitView and autolayout

纵饮孤独 提交于 2019-12-20 09:49:35
问题 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)]|"

Accessing methods, actions and/or outlets from other controllers with swift

随声附和 提交于 2019-12-13 08:04:58
问题 I'm working on a macOS project where I have a split view containing 2 other ViewControllers and I can't figure out how to access the ViewControllers from my primary window's ViewController. this is the setup: Basically what I'm trying to do is use the Button in my ViewController on the top-left to access the Label in my SectionController on the right, which is embedded in my split view. Since I can't create an IBAction or IBOutlet for a control in a different ViewController, I can't figure

NSSplitViewController in OSX 10.10 using Xcode 6

筅森魡賤 提交于 2019-12-12 08:10:24
问题 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

How to make controller in NSToolbar moving with NSSplitViewController's view like Reeder or Mail.app

倖福魔咒の 提交于 2019-12-11 12:53:17
问题 I am developing a cocoa application. It contains a toolbar having some feature buttons. Just like Reeder. I want to resize the toolbar section while resizing the split view. Something works like below. How to implement this kind of feature? Any one can help me or give some suggestions will be appreciated. I am developing with XCode7, Swift and Storyboard. 回答1: Obviously there isn't any way to add a splitView to the toolbar itself and i suspect what we see in reeder is not a standard toolbar.

How to remove a SubView from a NSSplitView in cocoa?

廉价感情. 提交于 2019-12-11 10:17:09
问题 I'm loading two different views with this IBActions - (IBAction)showFirstView:(id)sender{ theDetailViewController = [DetailViewController new]; [theDetailViewController initWithNibName:@"DetailView" bundle:nil]; NSView *splitRightView = [[theSplitView subviews] objectAtIndex:1]; NSView *aDetailView = [theDetailViewController view]; [aDetailView setFrame:[splitRightView bounds]]; [aDetailView setAutoresizingMask:(NSViewWidthSizable | NSViewHeightSizable)]; [splitRightView addSubview

Using autolayout, how can I center a subview in an NSSplitView without forcing the width NSSplitView to be static?

大憨熊 提交于 2019-12-11 02:06:29
问题 I have an NSSplitView with content in both NSViews. The left NSView has 2 constraints – Equal Widths and Equal Heights . The right NSView has something simple, say an NSTextField, which is centered via constraints Center X Alignment and Center Y Alighment . This is what I hoped it would look like as I resize the window and/or the NSSplitView divider: This is what's happening: I've tried a great deal of configuration changes, I've tried using an NSSplitViewController vs just dropping an

How do I fix the height of my view after collapsing NSSplitView?

こ雲淡風輕ζ 提交于 2019-12-08 02:48:09
问题 I've got an NSSplitView with an NSScrollView in the bottom view. The problem is when I collapse, and then re-open (un-collapse) the bottom view, the height of the scroll view is beyond the height of that bottom view so the top part of the scoll view is being clipped. I've got my scroll view and my split view set to autoresize in all directions in IB. Do I need to adjust the height of that scroll view after the un-collapse or am I setting a resizing property wrong, or something else? Below is

How to hide a divider of nssplitview?

好久不见. 提交于 2019-12-07 13:18:49
问题 Now I want to hide or show with my condition a divider when my app run. used this delegate method: - (BOOL)splitView:(NSSplitView *)splitView shouldHideDividerAtIndex:(NSInteger)dividerIndex { if (A) return YES; else return NO; } but it didn't work , why? How to used this method? Thank you very much! 回答1: The split view sends that message to its delegate, to ask the delegate whether it should hide that divider. So, be the delegate, and answer the split view's question. Be sure to check out

Starting Position of NSSplitView divider

邮差的信 提交于 2019-12-06 18:54:05
问题 How can I set the start position of a NSSplitView? The closest thing I've found that looks like it would work is setPosition //Set splitView position. [splitView setPosition:330 ofDividerAtIndex:0]; This doesn't seem to do anything though, my splitview still starts with the divider in the center. ANy ideas? 回答1: Maybe that is the center? If splitView is correctly hooked up to your split view, that code should work. You should probably log [splitView minPossiblePositionOfDividerAtIndex:0] and