Questions tagged [nstoolbaritem]

NSToolbarItem refers to the class in the graphical user interface toolkit Appkit framework that is an item in a window's toolbar, and which inherits from NSObject. Use this tag for questions related to such a class.

NSToolbarItem refers to the class in the graphical user interface toolkit Appkit framework that is an item in a window's toolbar, and which inherits from NSObject. Use this tag for questions related to such a class.

96 questions
2
votes
0 answers

OS X Yosemite does not show ToolBar icons when windows is displayed as sheet

an NSWindowController loads its NSWindow from a XIB file. The windows uses a NSToolBar to offer some options. Nothing special so far. Usually I use the following code to display the window as sheet: settingsController = [[SettingsWindowController…
Andrei Herford
  • 17,570
  • 19
  • 91
  • 225
2
votes
0 answers

NSToolbarItems removing gives constraint error

I have a NSToolBar with few toolbar items in it. I added this toolbar and items in xib file. In a specific situation I want to add another new toolbar item and remove it again when I complete the task related to it. I am able to do this, but with…
Juno
  • 347
  • 2
  • 11
2
votes
0 answers

NSToolbar remove item gives constraint error

I am trying to remove an item from a selected index using, [toolbar removeItemAtIndex:9]; This gives me this Unable to simultaneously satisfy constraints: ( "
Xander
  • 902
  • 2
  • 14
  • 33
2
votes
0 answers

How to implement NSToolbarItem Drag/Drop behaviour?

I have a typical cocoa application. There is a toolbar item on the toolbar, current behaviour is to draw a rectangle in the view of main window whenever this toolbar item is clicked. However, now there is a new requirement: user needs to be able to…
Simon
  • 705
  • 1
  • 5
  • 11
2
votes
1 answer

NSToolbarItemGroup - doesn't work?

NSToolbarItemGroup is documented here. I can't find much more than that about it! I'm trying to use it, to see how it looks. My code is basically lifted directly from the documentation. However, I never see the 'group' in my toolbar. The code runs,…
TheNextman
  • 12,428
  • 2
  • 36
  • 75
2
votes
1 answer

how to implement the NSToolbarItem Animation like evernote

I want to implement an animation which is like the sync animation of evernote app on Max OS X. The button looks like: When the animation runs, only is the white arrow rotating. I tried to use Core Animation, and the steps are following: 1 I dragged…
scorpiozj
  • 2,687
  • 5
  • 34
  • 60
1
vote
0 answers

Show and Hide NSToolbarItems

In my application, i need to display toolbars items, Initially all the items should be disabled and on a particular action it should be enabled, To do so, i am calling following function, -(void)disableToolBarItems{ NSArray…
Amitg2k12
  • 3,765
  • 10
  • 48
  • 97
1
vote
1 answer

doesnt work: NSToolbarItem + custom view + setAction:

I'm adding a toolbar programmatically inside an interface inheriting NSObject , and implementing these methods: - (NSToolbarItem*)toolbar:(NSToolbar*)toolbar itemForItemIdentifier:(NSString *)itemIdentifier…
yolo
  • 2,757
  • 6
  • 36
  • 65
1
vote
1 answer

NSToolbarItem Image Looks Bad Small in Running App but not in Interface Builder

I have some NSToolbarItems that I am creating from higher resolution images than the ultimate size they need to be displayed. I am using PDFs for the GIF & PNG images, and a PNG for the MacPaint icon in the Xcode Asset Catalog. The auto-shrunk size…
davecom
  • 1,499
  • 10
  • 30
1
vote
3 answers

NSToolbarItem availability based on OS X version

I have an application that will be available across multiple versions of OS X. What's the best way to make an NSToolbarItem only available to users in certain OS versions. When it is not available, it should be completely hidden, not just…
spudwaffle
  • 2,905
  • 1
  • 22
  • 29
1
vote
1 answer

IBOutlet on NSToolbarItem subclass causes image to disappear and interaction to be disabled

I am implementing a preferences window, with a subclass of NSToolbarItem that has an IBOutlet to an NSView (the idea being that when an item is clicked, it will display its view). However, when I connect a toolbar item to an instance of the…
user647562
1
vote
1 answer

Using toolbar with several NSViewControllers

I've a single window Document-based application that loads several NSViewControllers that serve as the main view. Each view controller is a self-contained class that deals with certain business needs and as such implements all methods necessary to…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
1
vote
2 answers

NSToolbar Flexible space not working in Swift 5.x

I developed this app using Xcode 10.1 (Swift 4.2 I believe) and toolbar looks good: But I ported in over to my Xcode 11.6 (Swift 5.2 I believe), now the right-most item on the toolbar is no longer on the far right: Before the port, I added that…
1
vote
1 answer

What is the correct way to create toolbar buttons with Xcode 12

I am trying to recreate an apps toolbar using the new XCode12/macos11 capabilities but can't seem to reproduce the same result that the Apple apps get. You can see my app on the left with the smaller icon, Xcode 12 in the middle and Safari on the…
Duncan Groenewald
  • 8,496
  • 6
  • 41
  • 76
1
vote
1 answer

How to detect a click from an NSToolbarItem inside an NSWindowController?

I have a toolbar on my macOS app, developed in Swift. The toolbarItem is dragable onto the NSWindowController, and I can setup an IABAction function, I just have a print in the function at the moment. And when I click on the button nothing happen…
Remi
  • 11
  • 2