Questions tagged [nstoolbar]

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

187 questions
23
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
  • 23,724
  • 40
  • 138
  • 242
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
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,400
  • 1
  • 12
  • 21
13
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
  • 27,599
  • 40
  • 143
  • 217
11
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,101
  • 3
  • 28
  • 48
11
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
  • 1,891
  • 1
  • 20
  • 31
10
votes
3 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,449
  • 16
  • 31
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
  • 27,599
  • 40
  • 143
  • 217
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
  • 165
  • 1
  • 8
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,477
  • 5
  • 28
  • 38
8
votes
1 answer

How to create consistent toolbar buttons with icons

Desired look I wish to make a toolbar for my app that will contain some simple buttons, each with a single monochromatic icon. Here is an example of some toolbar buttons similar to I'm trying to achieve, from Mail's compose window: Notice these…
Alexander
  • 48,074
  • 8
  • 78
  • 121
8
votes
1 answer

NSToolbarItem validation in relevant controller

I have an NSToolbarItem with an NSButton as its view and an NSMenuItem in the main menu. Both have the same action, which is sent to the first responder, not to a particular target. That method is ultimately implemented in a subclass of…
Eitot
  • 166
  • 1
  • 8
8
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
  • 915
  • 1
  • 14
  • 30
8
votes
1 answer

Toggle NSToolbarItem between Black and Blue

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,…
ArtOfWarfare
  • 17,763
  • 14
  • 122
  • 177
7
votes
2 answers

How can I hide an NSToolbarItem using code?

I have a toolbar with various options and some options should not be visible in some cases. I have already figured out a way to disable them in my application, using this callback: - (BOOL) validateToolbarItem: (NSToolbarItem *) toolbarItem But I…
Maurício Linhares
  • 37,947
  • 14
  • 116
  • 153
1
2 3
12 13