nssplitview

Create NSSplitView + subview programmatically

半世苍凉 提交于 2021-02-06 12:50:12
问题 I am trying to create a horizontal NSSplitView programmatically and to add it 2 subviews. Unfortunately, if I have no issue to create the splitview, I do not know how to add the subview. Do you have any idea to do it? 回答1: You add panes to a split view the same way you add subviews to any view. Each of the split view's subviews will get its own pane. You can use the adjustSubviews method to automatically resize the views so that each pane is the same size. This example code will create a

Create NSSplitView + subview programmatically

橙三吉。 提交于 2021-02-06 12:49:58
问题 I am trying to create a horizontal NSSplitView programmatically and to add it 2 subviews. Unfortunately, if I have no issue to create the splitview, I do not know how to add the subview. Do you have any idea to do it? 回答1: You add panes to a split view the same way you add subviews to any view. Each of the split view's subviews will get its own pane. You can use the adjustSubviews method to automatically resize the views so that each pane is the same size. This example code will create a

Create NSSplitView + subview programmatically

霸气de小男生 提交于 2021-02-06 12:49:48
问题 I am trying to create a horizontal NSSplitView programmatically and to add it 2 subviews. Unfortunately, if I have no issue to create the splitview, I do not know how to add the subview. Do you have any idea to do it? 回答1: You add panes to a split view the same way you add subviews to any view. Each of the split view's subviews will get its own pane. You can use the adjustSubviews method to automatically resize the views so that each pane is the same size. This example code will create a

Create NSSplitView + subview programmatically

不羁的心 提交于 2021-02-06 12:48:47
问题 I am trying to create a horizontal NSSplitView programmatically and to add it 2 subviews. Unfortunately, if I have no issue to create the splitview, I do not know how to add the subview. Do you have any idea to do it? 回答1: You add panes to a split view the same way you add subviews to any view. Each of the split view's subviews will get its own pane. You can use the adjustSubviews method to automatically resize the views so that each pane is the same size. This example code will create a

Create NSSplitView + subview programmatically

旧巷老猫 提交于 2021-02-06 12:48:30
问题 I am trying to create a horizontal NSSplitView programmatically and to add it 2 subviews. Unfortunately, if I have no issue to create the splitview, I do not know how to add the subview. Do you have any idea to do it? 回答1: You add panes to a split view the same way you add subviews to any view. Each of the split view's subviews will get its own pane. You can use the adjustSubviews method to automatically resize the views so that each pane is the same size. This example code will create a

How to collapse an NSSplitView pane with animation while using Auto Layout?

僤鯓⒐⒋嵵緔 提交于 2021-01-21 07:27:26
问题 I've tried everything I can think of, including all the suggestions I've found here on SO and on other mailing lists, but I cannot figure out how to programmatically collapse an NSSplitView pane with an animation while Auto Layout is on. Here's what I have right now (written in Swift for fun), but it falls down in multiple ways: @IBAction func toggleSourceList(sender: AnyObject?) { let isOpen = !splitView.isSubviewCollapsed(sourceList.view.superview!) let position = (isOpen ? 0 : self

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

≡放荡痞女 提交于 2019-12-31 09:45:06
问题 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

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

六眼飞鱼酱① 提交于 2019-12-31 09:44:27
问题 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

Align NSToolbarItems with NSSplitView columns

久未见 提交于 2019-12-31 00:50:11
问题 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

How to expand and collapse parts of NSSplitView programmatically?

不问归期 提交于 2019-12-29 14:31:22
问题 I want to replace RBSplitView with NSSplitView in my existing project. The application is now leopard only and I would like to replace RBSplitView with the new NSSplitView shipped with Leopard. However, I'm missing RBSplitView 's handy methods expand and collapse in NSSplitView . How can I expand and collapse parts of NSSplitView programmatically? 回答1: I just got programmatic expanding and collapsing of NSSplitView to work. I've also configured my NSSplitView to expand/collapse a subview