nsstatusitem

Cocoa Keyboard Shortcuts in Dialog without an Edit Menu

I have an LSUIElement application that displays a menubar status item. The application can display a dialog window that contains a text field. If the user right-clicks/control-clicks the text field, a menu appears that allows cut, copy, paste, etc. However, the standard Command-X, Command-C, and Command-V keyboard shortcuts do not wor...

How to efficiently assign NSStatusItem images and alternte images?

Let's say I have a code like this... - (id) init { ... self.myImage1 = [NSImage imageNamed:@"some_image_name"]; // setter retains ... } - (void) setStatusItemImage { [self.statusItem setImage:self.myImage1]; } I also want to animate the status item so I created 6 variants of the "updating" status item icon and loop it...

How to get the on-screen location of an NSStatusItem

Hi Fokes, I have a question about the NSStatusItem for cocoa in mac osx. If you look at the mac app called snippets (http://snippetapp.com/ look @ the movie there). you will see that once you clicked your statusbar icon that a perfectly aligned view / panel or maybe even windows appears just below the icon. My question is ... How to c...

Custom NSView in NSMenuItem not receiving mouse events

I have an NSMenu popping out of an NSStatusItem using popUpStatusItemMenu. These NSMenuItems show a bunch of different links, and each one is connected with setAction: to the openLink: method of a target. This arrangement has been working fine for a long time. The user chooses a link from the menu and the openLink: method then deals w...

NSStatusItem (cocoa) location on screen

I am trying to get the on screen location of an NSStatusItem so that I can perform a click on that area via code like below. I am doing this so that my users can press a hotkey to see the menu. event = CGEventCreateMouseEvent(NULL, kCGEventLeftMouseDown, newLocation, kCGMouseButtonLeft); CGEventPost(kCGHIDEventTap, event); CFRelease(eve...

Custom NSStatusItem with custom view - Use NSWindow, NSView, custom NSMenuItem?

I'm trying to create a LSUIElement app that behaves like Spotlight, CoverSutra and other apps of that type. I managed to create a custom NSStatusItem, which popups up an NSWindow but the problem is that the app that currently has focus will the focus to my custom NSWindow. I've based myself on Matt Gemmell's example (http://mattgemmell....

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 default, but whichever. When the status item is clicked, it triggers [NSApp activateIgnoringO...

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]; [_statusItem setMenu:menu]; [_statusItem setHighlightMode:YES]; To generate statusBa...

How to draw a native looking statusitem background on a CALayer

Hi. Actually I want to draw the background of a selected NSStatusItem on the CALayer of my custom statusItemView. But since - (void)drawStatusBarBackgroundInRect:(NSRect)rect withHighlight:(BOOL)highlight does not work (?) on layers I've tried it to draw the color with the backgroundColor property. But converting the selectedMenuIte...

Monobjc :: Add NSStatusItem

Hi, I'm trying to add an NSStatusItem from within the Monobjc bridge for Mono. The function gets called, and doesn't throw an exception, but my icon doesn't appear :(. Here 's my code: #define DEBUG_APP using System; using Monobjc.Cocoa; using Monobjc; namespace YvanSoftware.TwitMenu { [ObjectiveCClass] public class TwitMenuControl...

Right-click on a NSStatusItem

Hi. I have a NSStatusItem and I want to popup a menu by rightclicking the item. I subclassed a NSView and overwrote the - (void)rightMouseDown:(NSEvent *)event method. I also implemented - (void)mouseDown:(NSEvent *)event for looking at the modifierflags. My problem is, that the view does not recieve the NSRightMouseDown-Event. And I don...

How to make an NSMenu recent list

I'm working on a small URL shortening application for someone, and I need to have a list, similar to that of Droplr's, that has all of the recently shortened URLs. The list should be a submenu of the main menu, which is attached to an NSStatusItem. I need to have that list add an item each time a URL is shortened, and I'd like to have a...

NSTextField and backgrounded application

Hello, I'm building an application that uses a NSStatusItem and run in the background. The problem I'm running into is entering text into a NSTextField. I've got a menu item in my NSStatusItem which: [NSApp activateIgnoringOtherApps:YES] [prefPanel makeKeyAndOrderFront:nil] It shows up fine, but when I try to enter text into the NST...

How do I use an indeterminate status indicator as the image for an NSStatusItem?

I have an application that is an NSStatusItem. It has a few different modes, each of which require an external process to be launched, during which the icon is simply highlighted, and appears to be frozen. I want to use the -setImage: method (or reasonable facsimile) to display something along the lines of a "spinner" commonly seen in ...

How force NSMenuItem to redraw?

Hi, 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 number of results stays the same, items titles are not updated (redrawn). How do I force t...

Create a Custom View with transparent background for a NSStatusItem

Good Morning, I've created a Status Bar Application for Mac: when I click on the icon in menu bar, a NSCustomView appears with some elements. My NSCustomView is too simple, so I want to create something like this: (Snippet.app) http://i.imgur.com/aweP7.png I've searched in Apple Documentation, but I didn't find nothing usefull. Maybe...