Questions tagged [nsstatusitem]

The NSStatusItem class represents the individual elements displayed within an NSStatusBar object.

218 questions
1
vote
2 answers

Custom right click menu for a WebView inside an NSStatusItem

I have a WebView embedded in an NSStatusItem, and I want to display an NSMenu that I've built in Interface Builder when the user right clicks on the WebView / NSStatusItem. What is the easiest way to do this?
Chetan
  • 46,743
  • 31
  • 106
  • 145
1
vote
1 answer

How to update a Status Item created by AppDelegate from NSViewController

I'm trying to create a Countdown Timer application that runs in the Menu Bar, with no window or dock icon. I've been building this off of mostly tutorials I find online and I know the code is kind of messy (I plan to clean up after it functions…
Zardoz
  • 39
  • 1
  • 7
1
vote
1 answer

Mac OS - Change Status Item Button Image

I want to update the image when the user clicks something in the application but I can't get it to work. The status item with the menu is defined in the AppDelegate. I am trying to update the image in the ViewController with this piece of code which…
Infiltrator
  • 309
  • 2
  • 13
1
vote
1 answer

How to automatically close an NSPopover in NSStatusBar on Exposé/Mission Control

For other applications, like Dropbox and 1Password, the popover that opens when you click the NSStatusItem in the top bar automatically hides (and then reshows) if you open up Exposé/Mission Control with F3 to switch spaces. How is this…
Alex Beals
  • 1,965
  • 4
  • 18
  • 26
1
vote
2 answers

load a menu from nib

I have a Main.xib, with the main window, the main menu, and a second menu with a name "StatusMenu" that connects nowhere. In my application, I have an NSStatusItem, and I want to press it, and display that secondary menu. How can I connect those…
pvinis
  • 4,059
  • 5
  • 39
  • 59
1
vote
2 answers

NSPopover and adding spacing with NSStatusItem

I am working on a menubar app, that uses NSPopover. I am using the following code to present popover. [self.mainPopover showRelativeToRect:[testView bounds] ofView:testView preferredEdge:NSMinYEdge]; Issue is this is being present too close to…
Mirza Bilal
  • 891
  • 11
  • 34
1
vote
2 answers

How to prevent my macOS Menu Bar app from disappearing

I've been playing around with creating a Menu Bar app for macOS. The app consists of an icon along with a title. The title displays additional context and can be dynamic width. I've noticed that when the Menu Bar does not have enough room to display…
Simon
  • 2,065
  • 3
  • 21
  • 28
1
vote
1 answer

NSStatusItem left click

First : I'm new with Swift developpement. I'm using this tutorial to make a popup that will appears when I click on my top bar icon. So my AppDelehgate code is : func applicationDidFinishLaunching(_ aNotification: Notification){ print("START…
Antoine
  • 135
  • 5
1
vote
3 answers

Show NSOpenPanel in a NSStatusItem app

I am writing a status item app that does not have an NSWindow. I to pull up an NSOpenPanel when the user clicks on the status item. How would one do this when the app does not utilize an NSWindow? Thanks.
David
  • 14,205
  • 20
  • 97
  • 144
1
vote
1 answer

Swift: NSStatusItem remains highlighted after right-click

I created a NSStatusBarItem and popUp a (programmatically generated) NSMenu on right click: let statusBarItem = NSStatusBar.system().statusItem(withLength: -1) statusBarItem.action = #selector(AppDelegate.statusBarItemAction(sender:)) let menu =…
ixany
  • 5,433
  • 9
  • 41
  • 65
1
vote
0 answers

Status Item NSPopover won't display if app is fullscreened

I'm having trouble getting a NSPopover for my app to display when an app is full screened. It doesn't matter if the app is mine or another. Image below is the popover displaying out of fullscreen, fullscreen it just flickers with nothing showing.
John
  • 2,410
  • 1
  • 19
  • 33
1
vote
1 answer

How to dynamically place NSView in relation to NSStatusBar?

I have created a NSStatusBar NSMenu like this: - (NSMenu *)startUpViewBarMenu { NSMenu *menu = [[NSMenu alloc] init]; NSMenuItem* info = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; //[info setTarget:self]; …
maxisme
  • 3,974
  • 9
  • 47
  • 97
1
vote
2 answers

How force NSMenuItem to redraw?

I'm implementing a custom status bar menu, which has a custom view with NSSearchField. I'm updating number of menu items according to search results. The number of menu items is changed as user types in the NSSearchField. I've noticed, that if…
Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
1
vote
0 answers

Status bar app popover always on top when mission control is launched OSX

I'm working on a status bar app for OSX and I'm trying to replicate the behaviour of the popover that Dropbox uses, so far I've managed to get all of the desired behaviour working except for the fact that when I open mission control the popover…
1
vote
3 answers

NSStatusItem reordering along Status Bar

I am trying to add a functionality to my status bar app for Mac OS X. I would like to be able to move my item along the bar, as you can do for the native OS tools like the Bluetooth or the WiFi icon. Cheers
Fabrizio Demaria
  • 453
  • 1
  • 4
  • 15