nssplitviewcontroller

NSSplitViewController/NSSplitViewItem support in XIBs

痞子三分冷 提交于 2021-01-27 14:24:19
问题 Is there support for NSSplitViewController/NSSplitViewItem for XIBs? I see only NSSplitView Can I just drag&drop NSViewController and subclass it as NSSplitViewController? How do I add NSSplitViewItem that it mostly works out of the box? I can easily see support for them in storyboards. 回答1: The split view controller is not part of the object library for xib files. The easiest way to use split view controllers is to use storyboards. If you are unwilling to use storyboards, your best option is

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

NSToolbarFlexibleSpaceItem is constraint to NSSplitViewItem in Swift

余生长醉 提交于 2019-12-12 16:08:33
问题 Almost all macOS official apps have this toolbar's feature which the NSToolbarItem flexible space is constraint to NSSplitViewItem view. I first thought maybe there are 3 different sections on NSToolbar. But it just ONE toolbar. You can open Notes app and customize the toolbar. The first flexible space is detected and moved along with first split view item. The second flexible space is detected and moved along with the second split item. The rest will be just normal flexible spaces. If there

NSSplitViewController causing contained views to draw over window corners

前提是你 提交于 2019-12-12 09:57:18
问题 I'm trying to create a little Finder clone using Cocoa. I'm placing a source list table view (to act as a sidebar) and a standard table view inside of an NSSplitView controlled by an NSSplitViewController . Unfortunately, when I run this, the standard table view's white background is drawn over the bottom right corner of the window, resulting in a non-rounded corner: I'm able to avoid the problem by not using NSSplitViewController , both with standard nib files or storyboards to get the

Instantiating split view controller by identifier in OS X storyboard does not load view hierarchy

人走茶凉 提交于 2019-12-11 09:06:49
问题 I'm trying to implement a master-detail-detail view in a Swift OS X application. The top-level view controller is an NSSplitViewController with three subview controllers. The master and first detail views are fairly standard with fixed behaviors. The second detail view needs to change according to the selection in the first detail view. The second detail controller is a simple view controller, which will respond to selection changes in the first detail view by installing a new subview and

NSSplitViewController based application almost never launches with the correct size

自古美人都是妖i 提交于 2019-12-09 06:07:36
问题 I have this app that uses a NSSplitViewController as the root and has a NSTabViewController connected as its detailViewController. This app is set to launch at 1024x768. The left pane should launch at 320x768 and the right pane (where the tabViewController is), should launch at 704x768. From 10 times I run this app, 9 times it will launch with the incorrect size (about 500x500). Other strange thing is that this app should not be scalable, but if you hover the mouse near the window border you

NSSplitViewController causing contained views to draw over window corners

浪尽此生 提交于 2019-12-06 02:05:03
I'm trying to create a little Finder clone using Cocoa. I'm placing a source list table view (to act as a sidebar) and a standard table view inside of an NSSplitView controlled by an NSSplitViewController . Unfortunately, when I run this, the standard table view's white background is drawn over the bottom right corner of the window, resulting in a non-rounded corner: I'm able to avoid the problem by not using NSSplitViewController , both with standard nib files or storyboards to get the desired result: But… I really want to use NSSplitViewController . Is there any way to prevent this from

NSSplitViewController based application almost never launches with the correct size

痞子三分冷 提交于 2019-12-03 06:46:46
I have this app that uses a NSSplitViewController as the root and has a NSTabViewController connected as its detailViewController. This app is set to launch at 1024x768. The left pane should launch at 320x768 and the right pane (where the tabViewController is), should launch at 704x768. From 10 times I run this app, 9 times it will launch with the incorrect size (about 500x500). Other strange thing is that this app should not be scalable, but if you hover the mouse near the window border you see cursor indication to scale. I want this to launch at the correct size and have no scalable option.

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