The NSStatusItem class represents the individual elements displayed within an NSStatusBar object.
Questions tagged [nsstatusitem]
218 questions
0
votes
1 answer
Status item right click not triggering cocoa?
I want to trigger the right click on statusitem i am able to trigger left click but not right click .
-(void)applicationWillFinishLaunching:(NSNotification *)notification{
statusItem = [[NSStatusBar systemStatusBar]…

premkolindala
- 161
- 10
0
votes
1 answer
Communicate with NSView from another class
I have an NSView thats used as a status item and I need to run this on/in it:
thingOne = NO;
[self setNeedsDisplay:YES];
but can't figure out how. I tried sending a notification (form another notification a class gets) but the notifications never…

nosedive25
- 2,477
- 5
- 30
- 45
0
votes
0 answers
NSStatusItem doesn't show up in the Menu Bar
I was working on my menu bar app and made the NSStatusBarButton look like I want. Then I restructured the code a bit and suddenly after running it without any compiler errors/warnings, the button doesn't show up in the menu bar anymore.
I've already…

Cemal K
- 96
- 8
0
votes
0 answers
Custom NSMenuItem view is not enabled when used in NSMenu in NSStatusItem
I want to add a custom view to a NSMenuItem which I will display in a menu in a NSStatusItem.
After adding the custom view the NSMenuItem it isn't clickable any more - it seems disabled.
Using the sample code below without adding a custom view…

Mike Nathas
- 1,247
- 2
- 11
- 29
0
votes
1 answer
Handling onMouseOver and onMouseOut on a NSStatusItem
I have a status menu with a few items inside of all. All of the status items are custom and have custom views inside.
How do I detect when the user's mouse is over the NSView (inside of the item) or status item itself?

Andrew M
- 4,208
- 11
- 42
- 67
0
votes
2 answers
COCOA: NSStatusitem icon disappearing on launching external code
I am a .Net developer that needs to port a small program over to Mac OS X. I have this mostly done (partly thanks to people on this site, thanks!) but have a bug that maybe people I can get help with.
I am creating a tool that sits in the status…

Dan
- 103
- 1
- 5
0
votes
1 answer
How to change NSStatusItem out of class
I create a NSStatusItem in a class named StatusMenuController like this
class StatusMenuController: NSObject {
let statusItem = NSStatusBar.system().statusItem(withLength: NSVariableStatusItemLength)
override func awakeFromNib() {
let icon =…

Jinyu Meng
- 321
- 2
- 13
0
votes
1 answer
Seamless NSStatusItem button highlight for custom NSView overlay
I work on a custom OS-X Cocoa menu bar app. I put a custom NSView as subview on the NSStatusItem's button. It looks ok, however when selecting the button the blue highlight has overlay issues:
I'm using NSColor.clear wherever possible - the only…

itarato
- 795
- 1
- 8
- 24
0
votes
1 answer
Show menu for NSStatusItem with view
I have an NSStatusItem with a custom view (TimeView) set but this blocks the click from displaying the NSMenu associated with the NSStatusItem. If I disable the view for the NSStatusItem then the menu shows correctly, however, if I enable it then…

BenJacob
- 957
- 10
- 31
0
votes
1 answer
OS X NSStatusItem How to set the accessibility title for VoiceOver
There is no direct API (as far as I can see) but some applications seem to have it.
Although Apple's own icons (e.g. fast user switching, keyboard layout switching) do not have it.

guruz
- 1,604
- 14
- 21
0
votes
1 answer
How to Have Dropbox Pause Liked NSStatusBarItem's Button
I know how to make NSStatusBarItem's image for both light and dark mode (by just setting the image as template, image.template = true). Also, to make the button have disable appearance, we can play with appearsDisabled property.
However, there is…

João Oliveira
- 422
- 3
- 17
0
votes
1 answer
NSStatusItem with custom view, alpha value, and multiple displays
I have an app which has a NSStatusItem that uses a custom view. I apply an alpha value to the status item's view when a process in the app in inactive. This works fine, except on OS X 10.9 - 10.10 when multiple displays (monitors) are present. The…

William Gustafson
- 526
- 2
- 13
0
votes
0 answers
How to get location of NSStatusItem on the screen
I have a app with NSStatusItem on the menu bar. Now i want to use shortcut keys to call up the NSWindow which should be displayed right bellow the NSStatusItem. With mouse click i just get the position of status item with:
CGRect eventFrame =…

Quang Nguyen
- 354
- 1
- 5
- 20
0
votes
1 answer
NSStatusItem only responds after clicking twice
I have an OSX app with its own window in addition to an icon shown in NSStatusBar. The reason for the NSStatusBar is to enable the app to run in the background when main window closes. When trying to click the statusbar icon, I have to click twice…

Trond Kristiansen
- 2,379
- 23
- 48
0
votes
1 answer
Setting title for NSView
I have a NSStatusItem in my Cocoa projeсt, targeted on SDK 10.9. I also use NSStatusItem::setView here to implement semi-custom tray icon. Obviously, setTitle won't work here, because of custom view applied, that's why a question was born. How can I…

Ian P Badtrousers
- 389
- 3
- 12