nstoolbaritem

Does Cocoa connection binding to NSToolbarItem prevent deinitializing?

好久不见. 提交于 2019-12-11 01:13:00
问题 Trying to set the selected segment of an NSToolbarItem that's an NSSegmentedControl via connection binding to a property (optionSegment). Subclassing the window controller as such class MyWindow: NSWindowController { dynamic var optionSegment: Int = 0 override func windowDidLoad() { super.windowDidLoad() } } Alternately, put the optionSegment property in the NSDocument subclass and bind to that. Each work. The problem is that with this binding, or seemingly any binding to NSToolbarItem , none

Creating an outlet for a NSProgressIndicator inside a NSToolbar

≯℡__Kan透↙ 提交于 2019-12-08 03:13:39
问题 I have this OSX storyboard-based application that starts with a NSSplitViewController like this: This splitViewController has two viewControllers : master and detail. Inside the window I have a NSToolbar . I dragged a NSProgressIndicator to that toolbar and Xcode embedded it inside a NSToolbarItem . Now I need to create an outlet (not an action as explained on other stackoverflow questions) from the NSProgressIndicator to some class. First question is which one? Xcode will not let I create an

NSToolbarItem: “Make sure this toolbar item has a valid frame/min/max size”?

只愿长相守 提交于 2019-12-05 19:16:25
问题 Since upgrading to Mac OS Sierra and the new XCode version I get the following error every time I launch my application for every one of the NSToolbarItems: Example 1: 2016-09-29 12:46:58.659879 AppTest[] NSToolbarItem (<NSToolbarItem: >) had to adjust the size of <NSPopUpButton: > from {130, 26} to the expected size of {132, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on

NSToolbarItem: “Make sure this toolbar item has a valid frame/min/max size”?

青春壹個敷衍的年華 提交于 2019-12-04 03:44:23
Since upgrading to Mac OS Sierra and the new XCode version I get the following error every time I launch my application for every one of the NSToolbarItems: Example 1: 2016-09-29 12:46:58.659879 AppTest[] NSToolbarItem (<NSToolbarItem: >) had to adjust the size of <NSPopUpButton: > from {130, 26} to the expected size of {132, 27}. Make sure that this toolbar item view has a valid frame/min/max size. This is an app bug, please do not file a bug against AppKit or NSToolbar! Break on _NSToolbarAdjustedBorderedControlSizeBreakpoint Example 2: 2016-09-29 12:46:58.666074 AppTest[] NSToolbarItem (

Toggle NSToolbarItem between Black and Blue

爷,独闯天下 提交于 2019-12-04 03:29:53
I'd like to make an NSToolbarItem with a custom image which toggles between Black and Blue, like the icons at the top right of Xcode 5's main window. Peter Hosey suggested in this answer that it was as simple as setting the image to be a template , but I haven't found that to be the case. I set it to a template image, and that causes it properly render the dark gray gradient, but it doesn't render in blue when toggled. I uploaded a very simple example of what I've done, here. If someone could tell me how to change it to light up the NSToolbarItem in blue, as Xcode does, then I'd very much

Adding a custom view to toolbar

…衆ロ難τιáo~ 提交于 2019-12-03 16:29:17
问题 I'm struggling with Cocoa for 2 hours now without success. I want to add a custom view to the toolbar. So, I added a NSToolbar to the window (with IB), and added my view (which works perfectly). IB automatically created a NSToolbarItem. I followed the instructions from Apple here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Toolbars/Tasks/AddRemoveToolbarItems.html#//apple_ref/doc/uid/20000755-BBCGJCDJ The problem is that I don't know what to do now, the view doesn

Is it possible to draw in the label area of NSToolbar?

孤者浪人 提交于 2019-12-03 07:22:55
问题 I have a NSToolbarItem that uses a view similar to the Xcode status view. It currently has no label, but I can't figure out a way to draw into the area where the item label would normally be drawn. I would like the view to extend into that area just as the Xcode status view does. I know the very bottom portion of pixels of NSToolbar is out of bounds, but I have seen other applications draw into the label area. Any ideas? Edit: For clarification, this is the status view I'm referring to in

Adding a custom view to toolbar

那年仲夏 提交于 2019-12-03 05:38:39
I'm struggling with Cocoa for 2 hours now without success. I want to add a custom view to the toolbar. So, I added a NSToolbar to the window (with IB), and added my view (which works perfectly). IB automatically created a NSToolbarItem. I followed the instructions from Apple here: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Toolbars/Tasks/AddRemoveToolbarItems.html#//apple_ref/doc/uid/20000755-BBCGJCDJ The problem is that I don't know what to do now, the view doesn't show although it's label is displayed in the window. Here's the code I use to draw (very simple, it's

Is it possible to draw in the label area of NSToolbar?

▼魔方 西西 提交于 2019-12-02 22:09:22
I have a NSToolbarItem that uses a view similar to the Xcode status view. It currently has no label, but I can't figure out a way to draw into the area where the item label would normally be drawn. I would like the view to extend into that area just as the Xcode status view does. I know the very bottom portion of pixels of NSToolbar is out of bounds, but I have seen other applications draw into the label area. Any ideas? Edit: For clarification, this is the status view I'm referring to in Xcode: I want the bounds of my view to extend past the label area of the toolbar just as the view in Xcode

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