The NSStatusItem class represents the individual elements displayed within an NSStatusBar object.
Questions tagged [nsstatusitem]
218 questions
6
votes
1 answer
Get Notification of NSStatusItem frame change?
In an app that uses a NSStatusItem with a custom view like this:
... how can you get notifications when:
The status bar gets hidden because of a full screen app
The status item moves position because another item is added/removed/resized?
Both…

coneybeare
- 33,113
- 21
- 131
- 183
6
votes
1 answer
Cmd + click to move status item
The built in battery, wi-fi, sound, etc, Apple supplied status items, can be dragged to any position on the menu by using cmd + click and drag:
How can I support similar functionality in my own status item?

rid
- 61,078
- 31
- 152
- 193
5
votes
1 answer
NSTextField inside NSStatusBar: focus and editable problems
My Cocoa App is made by a NSStatusBar with a NSTextField inside and a Main Window.
Please, look the screenshots to get the idea:
I have two problems:
When I open Menubar I am unable to got the focus to SearchField (like Spotlight) and
I am…

pierocampanelli
- 960
- 5
- 19
5
votes
2 answers
Fuzzy text in NSStatusItem
I'm displaying a statusItem at launch like this:
theItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSVariableStatusItemLength] retain];
NSString *theString = [textField stringValue];
(textField.stringValue = theString);
[theItem…

Paul
- 234
- 2
- 10
5
votes
1 answer
NSStatusItem in NSStatusBar, action selector method not responding
First I declare the status item:
var status_item: NSStatusItem?
Then I have a function to close the widow and add the status item:
self.view.window?.orderOut(self)
//self.view.window?.close()
self.status_item =…

Heestand XYZ
- 1,993
- 3
- 19
- 40
5
votes
2 answers
Detect left and right click events on NSStatusItem (Swift)
I’m building a status bar app and want to call different actions depending on if the user clicked left or right. Here’s what I have so far:
var statusItem = NSStatusBar.system().statusItem(withLength: -1)
statusItem.action =…

ixany
- 5,433
- 9
- 41
- 65
5
votes
0 answers
NSTextField does not get focus back after losing focus
I have set an NSMenuItem's view to a custom view, which contains a textfield. When I run the program, everything works as expected. NSTextField is part of the NSStatusItem and accepts focus and I can type things in it.
After closing the menu and…

felix
- 11,304
- 13
- 69
- 95
5
votes
1 answer
NSButton corner radius and NSPopover
I'm using an NSPopover and I'm putting a NSViewController inside to be displayed as a custom view from a NSStatusItem. Most of the view controller displays correctly except for the NSButton that have a corner radius on them. There is some extra…

cmakthat
- 201
- 4
- 7
5
votes
0 answers
NSStatusItem set width
Im trying to reduce the width the NSStatusItem takes up. As you can see, the picture im setting is not that wide, yet the blue area is much wider. How do i reduce this?
Im using this code:
let icon = NSImage(named:…

OrangePot
- 1,053
- 2
- 14
- 38
5
votes
1 answer
OSX Status Bar Image Sizing - Cocoa
So i'm having a problem with the image of a NSStatusBar item, it seems like the image is pushing away from the rest of the menu items as you can see in this picture. But when the menubar is inactive (as in i'm on my other monitor or not in the app)…

Bolt Sandwich
- 65
- 1
- 6
5
votes
1 answer
NSMenuItem is not enabled swift
I have a NSMenuItem in my project:
var statusBar = NSStatusBar.systemStatusBar()
var statusItem : NSStatusItem = NSStatusItem()
var menuItem : NSMenuItem = NSMenuItem()
var mainMenu = NSMenu()
override func viewDidLoad() {
…
user4226616
5
votes
2 answers
NSStatusItem app focus
How can my menubar application achieve the same behaviours as 1Password or Dropbox:
clicking their menu bar icons or popovers does not steal focus, e.g. while I am in for example TextEdit and open 1Password/Dropbox, the blinking cursor disappears…

iMaddin
- 982
- 1
- 14
- 23
5
votes
2 answers
Show NSPopover when the application starts
I am using Pyobjc to create a NSStatusItem. When it is clicked, I am showing an NSPopOver. This is working fine. However, my requirement is to show the popover as soon as the application starts without any action by the user. Calling the callback…

Pradeep Vairamani
- 4,004
- 3
- 36
- 59
5
votes
2 answers
Is there any way to highlight the status bar item programmatically?
I'd like to perform the following:
when I click on the status bar item (NSStatusItem) I want to highlight it (no menu) indefinitely and when the application loses focus I want to stop highlighting it.
Is there any way of doing this? I can't find it,…

Pedro Vieira
- 3,330
- 3
- 41
- 76
5
votes
1 answer
Mac app - drag and drop files into a menubar application
My inspiration for this project is the Droplr and CloudApp mac menubar applications. I have been attempting to implement the code explained here.
However, when I implement the code, the menubar images disappear. Here is my code to create the status…

user1485691
- 51
- 3