Questions tagged [nsstatusitem]

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

218 questions
9
votes
1 answer

Display image in a cocoa status app

Hi I developed a cocoa status app. when I put a long title for example , it can't be shown and if i put an image as icon too it can't be shown , but if i put a small title it works correctly. How can I fix this problem and make the image…
user1503496
  • 191
  • 4
  • 13
8
votes
1 answer

Being apprised of when NSStatusItem is hidden

I have an app which uses an NSStatusItem. On small screens there's not much space in the status bar. When a user switches to an application with a lot of menu items, my status item gets hidden. Is there a way to get notified about this? What I tried…
stigi
  • 6,661
  • 3
  • 40
  • 50
8
votes
1 answer

How to open a window on click on NSStatusItem?

I'm pretty new to cocoa, so please excuse me for any stupid mistakes I make. I have a NSStatusItem, which I want to use to open up a menu. However as far as I know and have heard across different forms, without a custom view you are restricted to…
Luke
  • 95
  • 2
  • 5
8
votes
1 answer

What is alternative to NSStatusItem.popUpMenu?

NSStatusItem.popUpMenu has been deprecated in macOS 10.14, but I can't find a nice alternative. let m = statusItem.menu! statusItem.popUpMenu(m) // deprecated I tried direct pop-up using menu and the button, but it doesn't position properly. let m1…
eonil
  • 83,476
  • 81
  • 317
  • 516
8
votes
1 answer

How to develop status bar app in OS X Yosemite?

I've been trying to develop a status bar app for Yosemite, which is my first OS X app, but when I searched for the document, the NSStatusItem documentation says that almost all of the properties and methods there (e.g. .title, .highlightMode, and…
Blaszard
  • 30,954
  • 51
  • 153
  • 233
8
votes
0 answers

Prevent status bar NSPopover from activating main window

I'm implementing an NSPopover and having it appear in the status bar by setting it as a custom view. I've set its behavior to Transient, and also added a global event monitor so that when any other application gets focus, the NSPopover goes…
kbhomes
  • 288
  • 2
  • 13
8
votes
3 answers

Mavericks and NSStatusItem's custom view with multiple monitors

Since Mavericks each screen has its own status bar. This also means that an application running in the status bar (using NSStatusItem) theoretically has multiple NSStatusItem objects associated. In practice, although the user might see multiple…
Niels Mouthaan
  • 1,010
  • 8
  • 19
8
votes
2 answers

LSUIElement behaves inconsistently with activateIgnoringOtherApps

Specifically, it behaves inconsistently regarding text field focus. I have an LSUIElement popping up a status menu. Within that menu there is a view containing a text field. The text field needs to be selectable -- not necessarily selected by…
iconmaster
  • 175
  • 1
  • 10
7
votes
2 answers

Highlighting NSStatusItem with attributed string

I have a NSStatusItem, and I use an attributed string for it, setting is as such: [statusItem setAttributedTitle:as]; where as is my attributed string. I use it to highlight certain parts of the item when certain conditions are met by coloring them…
houbysoft
  • 32,532
  • 24
  • 103
  • 156
7
votes
1 answer

Correct way to setup target/action for NSMenuItem in Cocoa?

I'm having some real difficulty with some initial Cocoa programming I am carrying out. Essentially, I have an NSStatusBar item with an NSMenu attached as the menu. The menu has a single NMMenuItem. In IB I have connected the NSMenuItem to an…
Edwardr
  • 2,906
  • 3
  • 27
  • 30
7
votes
3 answers

Call Action when NSStatusBarButton is right-clicked

I am searching for a way to detect whenever the NSStatusBarButton is right-clicked (using Swift) and call an action. I am currently setting it up this way: let statusItem = NSStatusBar.systemStatusBar().statusItemWithLength(-1) func…
Devapploper
  • 6,062
  • 3
  • 20
  • 41
7
votes
1 answer

Keeping an NSStatusBarButton highlighted while popover is displayed

Practically all of NSStatusItem has been deprecated for 10.10 and the behavior of the underlying NSStatusBarButton seems to be confusing. Currently I am working on a menu bar application. When the user clicks the menu bar icon for the app, a method…
Metabble
  • 11,773
  • 1
  • 16
  • 29
6
votes
0 answers

How can I make an NSStatusItem take the full height of the menubar?

I'd like to have an item in the macOS menubar that takes the whole height of the bar. This can be seen, for example, in FaceTime's UI: In my attempts, I can only get the item to extend to 1pt away from the y edges of the menu bar: (Note that in a…
jnpdx
  • 45,847
  • 6
  • 64
  • 94
6
votes
4 answers

NSStatusItem right click menu

I'm working on a status bar app that has a left and right click. I've got the start of this working by following the tips from other posts but I'm not sure how to go about showing a menu on right click. I use a subclassed NSView as the custom view…
keegan3d
  • 10,357
  • 9
  • 53
  • 77
6
votes
1 answer

Objective-C: NSStatusBar right and left click

how to detect left or right click on statusbar icon, and than make some action, depending on which mouse button (trackpad) was clicked? I use: _statusItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:NSSquareStatusItemLength] retain]; …
Matt Harasymczuk
  • 1,728
  • 2
  • 21
  • 29
1
2
3
14 15