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
0
votes
1 answer

Why is my NSMenuItem is disabled when it has an action?

I'm implementing a custom NSToolbarItem that has a button and a dropdown, like Mail. The only thing that's not working, though, is that the NSMenuItem is disabled. Whatever I do, I can't get it enabled. Any idea what I'm doing wrong here? class…
user4992124
  • 1,574
  • 1
  • 17
  • 35
0
votes
0 answers

How to perform default double click action on customised NSToolbarItem with label

I have created a custom toolbar using storyboard which contain a toolbar item with label and buttons. The default double click action to zoom and zoom out(enlarging and minimising the window size) in toolbar is working except the label area. How to…
Angel
  • 112
  • 15
0
votes
0 answers

How to add text to segmented control in macOS so that it shows up in toolbar in text only mode?

How to add text to segmented control in macOS so that it shows up in toolbar in text only mode? Currently I am created the control like let tabbar = NSSegmentedControl(labels: ["One", "Two", "Three"], trackingMode: .selectOne, target: self, action:…
John Doe
  • 2,225
  • 6
  • 16
  • 44
0
votes
1 answer

NSToolbarItem Subclass not calling events

I've created a subclass for NSToolbarItem and am trying to catch the -(void)mouseDown:(NSEvent *)theEvent in order to change its state (that's what I added in my subclass as NSToolbarItem doesn't support states out of the box). Problem is that the…
Pripyat
  • 2,937
  • 2
  • 35
  • 69
0
votes
1 answer

NSToolbarItem is always nil in cocoa touch (os x) Mac?

I have set IBOutlet for NSSearchField but it's always find nil in .m file. Why??? If have any idea then please give answer related to my issues.
Chandresh Kachariya
  • 667
  • 2
  • 13
  • 31
0
votes
1 answer

toolbarSelectableItemIdentifiers: is not called

I'm trying to make selectable NSToolbarItems. I've connected everything correctly in IB, but toolbarSelectableItemIdentifiers: is not working. It doesn't get called. The delegate is the File's Owner (subclass of NSWindowController), and the toolbar…
user142019
0
votes
1 answer

Badly rendered controls in NSToolbar

I've tried to add buttons and segmented control into the toolbar, but they are badly rendered (Image for the better imagination) - too thin, no matter what I do, I set even max and min size of NSToolbarItem, nothing works. Any idea what's wrong?
PeterBocan
  • 101
  • 7
0
votes
1 answer

Custom draw on NSToolbarItem

I have a NSToolbar and I want to draw at the items. This works, if I use a NSView as item instead of an Image Toolbar Item. The problem: A NSView doesn't respond, if I connect it to an IBAction. How can I subclass an Image Toolbar Item, so that I…
Lupurus
  • 3,618
  • 2
  • 29
  • 59
0
votes
0 answers

Erratic action of NSToolbarItem

I am using toolbar buttons to control a simple NSTask. The code below works as expected when the IBAction is given by regular buttons, but produces artifacts when it is given by an NSToolbarItem. More precisely, the run button does not get disabled.…
0
votes
1 answer

NSToolbar items hidden using xibs migrated on Xcode 7

We are using xib files to show a window + toolbar. Compiling a Mac OS app with the latest Xcode (7 or 7.1) makes our toolbars items to be hidden for Yosemite 10.10.5, but it works fine on El Capitan. If I click the area, the actions are taken, so…
Mihai Panţiru
  • 513
  • 3
  • 16
0
votes
0 answers

NSToolbarItem not selectable

I am building my NSToolbarItem(s) programmatically but they are not selectable. The ones added from the interface builder are selectable because there i have the option of checking the 'Selectable ' option. But the NSToolbarItem class has no…
SiWM
  • 90
  • 1
  • 9
0
votes
0 answers

Toolbar button stays in-active in Cocoa Xcode 6 Storyboard Mac App

I am trying to add a simple IBAction to the Toolbar in the storyboard. I simply added the object to Window in the Window Controller and dragged at Image Toolbar Item to it. Added an image to it and placed in by default. Next I added a new class and…
doom4
  • 633
  • 5
  • 19
0
votes
1 answer

NSToolbarItem Highlights When It Shouldn't

I have strange behavior of NSToolbarItems that are in the toolbar of an NSPanel (Utility Panel) that's an inspector panel. When the panel first displays the three items are all OK As soon as I click on any of the items the left hand item is…
Paul Linsay
  • 449
  • 4
  • 6
0
votes
1 answer

Get the identifier of NSToolbarItem at index

I implemented a method that adds a toolbar item at index each time the method run. thetoolbar.insertItemWithItemIdentifier("safaributton", atIndex: 3) I must wrap this code that inserts the toolbar item with an if/else, else I get this item…
Gary Simpson
  • 2,677
  • 2
  • 17
  • 18
0
votes
2 answers

How to set IBOutlet for NSToolbar item in Xcode 6 OSX Storyboard

I am trying to set IBOutlet for a toolbar item in Xcode 6 for OS X application using storyboards. I have seen an example on setting a IBAction but it does not work for IBOutlets. Any help would be appreciated.