Questions tagged [nstoolbar]

NSToolbar and NSToolbarItem provide the mechanism for a titled window to display a toolbar just below its title bar.

207 questions
24
votes
4 answers

Adding buttons to Finder toolbar?

Dropbox has the option of adding a button to the Finder toolbar. It even appears in the 'Customize Toolbar...' window.   I can't find any documentation on how this sort of thing is done.... Does anyone know how to do this, or can anyone point me…
cannyboy
  • 24,180
  • 40
  • 146
  • 252
15
votes
6 answers

How to use NSToolBar in Xcode 6 and Storyboard?

I've been trying to build on a Cocoa app that uses Swift and Storyboard in Xcode 6, but how can I use NSToolbar there? In Xcode 5 and xib, you can add NSToolbar from within Object Library to any .xib files and then click on the added toolbar to…
Blaszard
  • 30,954
  • 51
  • 153
  • 233
14
votes
2 answers

Adding a custom view to toolbar

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…
user531461
13
votes
4 answers

how to enable/disable NSToolbarItem

I have a project that needs to disable/enable some NSToolbarItems depends on different options. I checked and found no parameter for this. Is there a way to enable/disable a given NSToolbarItem?
monsabre
  • 2,099
  • 3
  • 29
  • 48
13
votes
6 answers

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

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…
willbur1984
  • 1,418
  • 1
  • 12
  • 21
12
votes
1 answer

How to programmatically add new NSToolbarItem to existing toolbar?

I'm looking for a method called addNewItem:(NSToolbarItem *)item or something like this that lets me add a programmatically created item to my toolbar, but I haven't found any. I would like to add an item that shows a popover when the user clicks on…
Nickkk
  • 2,261
  • 1
  • 25
  • 34
12
votes
1 answer

Big Sur Toolbar Items in the Sidebar

In Big Sur, Xcode and Calendar have toolbar items that stay over the sidebar when open but remain visible on the left side when the sidebar's collapsed. Sidebar open: Sidebar collapsed: In "Adopt the New Look of macOS" at 13:55, John says "items…
smr
  • 890
  • 7
  • 25
11
votes
4 answers

NSToolbar in Xcode 7 using Storyboards (NSWindowController -> NSSplitViewController)

Hi I've seen this question asked a few times already but with no definite answer yet so I created it for xcode 7 and swift2 (which may have changed things a bit anyway). I created a project using Xcode 7 and Cocoa OSX Story boards + swift2, so my…
gbdavid
  • 1,639
  • 18
  • 40
10
votes
2 answers

How to use General and Downloads icon seen in Xcode's Preferences Panel?

I have been creating a preferences panel that would pop up when an user taps ⌘+, in my Cocoa app, and I like to use the same General and Downloads icons that are used in Xcode. However, as far as I know, when I moved Image Toolbar Item from Object…
Blaszard
  • 30,954
  • 51
  • 153
  • 233
9
votes
5 answers

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

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 () had to…
MMV
  • 297
  • 2
  • 9
9
votes
1 answer

NSButton in NSToolbarItem (setView) when clicked in "Text only" forces mode to "Icon and Label"

I am trying to recreate the nice textured buttons like Finder, Safari and Transmission have in their toolbar. First I started by just dragging in a "Texture button" in the IB and such. All works well except for when a user sets the toolbar to "Text…
Ger Teunis
  • 945
  • 1
  • 14
  • 30
8
votes
2 answers

Backwards compatibility of new NSSearchToolbarItem

With macOS 11 Apple has introduced a new NSToolbarItem called NSSearchToolbarItem that automatically resizes to accommodate typing when the focus switches to the toolbar item. Here Apple says this is backwards compatible with older versions of…
Daniel
  • 1,473
  • 3
  • 33
  • 63
8
votes
1 answer

How do I add items to NSToolbar with SwiftUI?

Consider this macOS app code implemented with app delegate lifecycle: App delegate: func applicationDidFinishLaunching(_ aNotification: Notification) { let contentView = ContentView() window = NSWindow( contentRect:…
Jaanus
  • 17,688
  • 15
  • 65
  • 110
8
votes
3 answers

Highlight NSToolbarItems

I want to highlight the selected NSToolbarItem like e.g. in Adium (see screenshot). highlight http://a2.s3.p.quickshareit.com/files/screenshot_b28b67ba9411513d6.png Is there an easy way? If not, tell me the difficult one. =)
papr
  • 4,717
  • 5
  • 30
  • 38
8
votes
2 answers

Hide NSToolbar in fullscreen

I'm making a Cocoa app, with a hidden unified NSToolbar and Titlebar. I've done so by adding a toolbar in the Window Controller and setting all the options to make this invisible and keep the 3 colored buttons. It works great in a normal window, but…
Herlid
  • 105
  • 1
  • 9
1
2 3
13 14