cocoa

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

Allow an NSWindow (NSPanel) to float above full screen apps

 ̄綄美尐妖づ 提交于 2021-02-06 12:48:26
问题 I'm trying to add a little window that provides "quick input" from any place in the system to the main app. The user could hit a hotkey, the window pops up, and floats above all other windows. For the most part, this isn't much of a problem. I can configure an NSWindow to be: level = Int(CGWindowLevelKey.TornOffMenuWindowLevelKey.rawValue) collectionBehavior = .CanJoinAllSpaces I can also make it an NSPanel with NSNonactivatingPanelMask option set. The only problem is: how can I make it so

CGDisplayIOServicePort is deprecated in OS X >= 10.9, how to replace?

陌路散爱 提交于 2021-02-06 10:11:51
问题 I did small app to allow quickly change screen resolutions on multiple monitors. I want to show product name as title of the monitor, and it's very simple to find using this code: NSDictionary *deviceInfo = (__bridge NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(dispID), kIODisplayOnlyPreferredName); NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]]; if([localizedNames count] > 0) { _title = [localizedNames

CGDisplayIOServicePort is deprecated in OS X >= 10.9, how to replace?

霸气de小男生 提交于 2021-02-06 10:10:36
问题 I did small app to allow quickly change screen resolutions on multiple monitors. I want to show product name as title of the monitor, and it's very simple to find using this code: NSDictionary *deviceInfo = (__bridge NSDictionary *)IODisplayCreateInfoDictionary(CGDisplayIOServicePort(dispID), kIODisplayOnlyPreferredName); NSDictionary *localizedNames = [deviceInfo objectForKey:[NSString stringWithUTF8String:kDisplayProductName]]; if([localizedNames count] > 0) { _title = [localizedNames

maximum image size in CIFilter / CIKernel?

女生的网名这么多〃 提交于 2021-02-06 09:30:48
问题 Does anyone know what the limitations are on image size with custom CIFilters? I've created a filter that performs as expected when the images are up to 2 mega pixels but then produce very strange results when the images are larger. I've tested this both in my cocoa app as well as in quartz composer. The filter I've developed is a geometry-type distortion filter that (I think) requires an ROI and a DOD that spans the entire input image. I've created this filter for remapping panoramic images

Anchors in help-book not working

帅比萌擦擦* 提交于 2021-02-06 09:11:52
问题 I've double checked everything and hoping someone can find a stupid mistake that I'm not seeing. I'm trying to build a Apple Help section for my application and it correctly goes to the landing page however none of the anchors work. The landing page is called index.html and the other page is called test.html which is located in the pgs directory. In index.html I have: <a href="help:anchor=support bookID=com.company.app_name.help">Link to another page</a> In test.html I have: <a name="support"