The NSStatusItem class represents the individual elements displayed within an NSStatusBar object.
Questions tagged [nsstatusitem]
218 questions
1
vote
1 answer
Need to make NSPopover appear during awakeFromNib?
I have a statusitem in the system menu bar that makes a popover appear when it is clicked. I would like to make the popover automatically appear when the application is first launched. I tried to add the [self clickStatusBar:self] to the…

wigging
- 8,492
- 12
- 75
- 117
1
vote
1 answer
NSMenuBar mouse down notification?
i'm trying to find notification/way to check if NSStatusItem from NSStatusBar (System wide bar) was clicked.
Does anybody knows how to achive this ?
Thanks
EDITED 20120111
I meant "any" item from whole status bar.

xyz
- 2,277
- 2
- 25
- 41
1
vote
0 answers
VoiceOver bug in menu of NSStatusItem
I've run into the following bug using VoiceOver. I'm new to Cocoa programming, so I'm curious if I am doing something wrong, or if there is another way to do this. The following code puts an icon on the menubar, and has a menu with 1 item.
When you…

Mira
- 161
- 7
1
vote
2 answers
control NSSlider with arrows on NSMenu for a NSStatusItem- Objective-C/Cocoa
I would like to create a status item with a vertical slider in it, much like the sound control provided by Apple. My question is: how do I make it react to the up/down arrow keys, just like the slider in the sound menu?
I have tried to create a…

Alex
- 5,009
- 3
- 39
- 73
1
vote
1 answer
NSStatusItem menu Action not firing
The NSStatusItem menu shows correctly but when I click on menu the action not fire.
Since the app is compatible with Mac Catalyst, I created framework then passing Framework to main app in order to show the menu of NSStatusItem, it work correctly…

Steven
- 762
- 1
- 10
- 27
1
vote
2 answers
How to detect Option key down in Status bar app
I have a Swift Cocoa app that runs as an NSStatusItem, i.e., it presents a dropdown menu in Mac's top-right status bar. I would like to display extra "advanced" menu items when the user holds down the Option key while opening my status item menu. I…

fsctl
- 161
- 8
1
vote
1 answer
Get length of NSStatusItem
I have a NSStatusItem in my app that can be configured to show some text. This text can change, and the problem is, every time it changes length, the whole status item changes its length, which causes "width flicker".
I thought about setting the…

houbysoft
- 32,532
- 24
- 103
- 156
1
vote
2 answers
Swift - How does one animate (pulse between opacity 0 and 1) a NSImage in the menu bar?
I'm new at Swift and I can't seem to find any resource for what I'm trying to achieve. Most of what I find applies only to views.
I have a statusBarItem:
statusBarItem = NSStatusBar.system.statusItem(withLength:…

Maxime Dupré
- 5,319
- 7
- 38
- 72
1
vote
1 answer
KVO on NSStatusItem.isVisible fires twice
I'm trying to use key value observation to determine when an NSStatusItem is dragged out of the menu bar by the user with the removalAllowed behavior. This is supported according to the docs:
Status items with this behavior allow interactive…

Ryan
- 1,053
- 12
- 21
1
vote
1 answer
Getting the screen position of a non-view based NSStatusItem
My application makes use of an NSStatusItem. I need to grab the screen coordinates for the status item, but since I have no need for the functionality offered by setting a custom view for the item I am using a standard icon-based one instead.
Is…

John Wells
- 1,139
- 1
- 10
- 27
1
vote
0 answers
macOS menu bar text with icon
As you can see in the image I would like to be able to do a similar one, to make a way that instead of showing only the icon of the sun, also showing a text.
As seen in the image below, an icon followed by a text.
But I only managed to do…

Paul
- 3,644
- 9
- 47
- 113
1
vote
1 answer
Dismiss Custom Window for NSStatusItem
I've got a custom window popping up when an NSStatusItem is clicked. The code is based on MAAtachedwindow. Everything is working great but I can't figure out a way to dismiss the window when the user clicks on something else like another status bar…

keegan3d
- 10,357
- 9
- 53
- 77
1
vote
0 answers
How do I highlight an NSStatusItem button programmatically?
I want to emulate the behaviour of the control centre in macOS (11.0) Big Sur.
I know that NSStatusItem.button.highlight(true) can be used to set the highlight of a menu bar button. However, when I try to highlight the button by adding…

tyirvine
- 1,861
- 1
- 19
- 29
1
vote
2 answers
Listen for Actions on a NSStatusItem With a Menu
I have a NSStatusItem with a menu attached. How can I get mouse/touch events from the status item without losing the menu? I was thinking perhaps some kind of workaround where I take in the events and manually pop the menu up, but I am unsure of the…

Kyle Berezin
- 597
- 4
- 20
1
vote
1 answer
How to draw custom view in NSStatusBar?
I currently have a NSStatusBar with a NSStatusBarItem with a title displaying. But I wan't to replace the title/text with a custom NSView. How can I do that?
I currently have:
func applicationDidFinishLaunching(_ aNotification: Notification) {
…

eivindml
- 2,197
- 7
- 36
- 68