Questions tagged [nsmenu]

OS X API : A class that defines an object that manages an application’s menus

365 questions
3
votes
1 answer

Custom NSmenuitem in Swift

I am having trouble using a custom NSMenuItem(). So far I have created a class: class AllCurrencyList: NSView { @IBOutlet var allccyimage: NSImageView! @IBOutlet var allccytext: NSTextField! } I have created a xib with the two IBOutlet…
anto0522
  • 662
  • 9
  • 31
3
votes
2 answers

Selecting the first item in a popUpContextMenu

I work on a very keyboard intensive application. Both hands on the keyboard. No hands on the mouse. A user can, via the keyboard, popup a context menu, select an item and finally hit enter. [NSMenu popUpContextMenu] displays the menu without…
neoneye
  • 50,398
  • 25
  • 166
  • 151
3
votes
1 answer

NSMenuItem number bubble?

I have seen something like this: in a Menulet on the right of menu items and I can't figure out how to do it. Can anyone elaborate? Thank you!
Aaru
  • 57
  • 5
3
votes
1 answer

Control NSMenuItem inset/padding?

Is it possible to control the inset or padding for NSMenuItems? I.e. for a menu used in my NSPopupButton I'd like to remove the left padding (normally used for the checkbox) and add some padding after the text. Can this be achieved (with public…
cacau
  • 3,606
  • 3
  • 21
  • 42
3
votes
2 answers

Can I open an NSMenu programatically?

Like the title says, I want to automatically open the menu at certain intervals. Preferably from within the program itself, as I am sure I could do something manually with applescripts+cron, which I don't want to use. I am talking about a…
jontelang
  • 589
  • 4
  • 17
3
votes
1 answer

How can you update an NSMenu while it is active (visible)?

I have an NSMenu instance, through which all communication with the Cocoa app will take place. If the menu is open, the background doesn't run, so how can I force an update while the menu is still active?
Alexsander Akers
  • 15,967
  • 12
  • 58
  • 83
3
votes
1 answer

Linking NSMenu to ViewController - Swift

I am working on a Yosemite app in swift and have hit a road block. I have multiple views working properly, and now I want to implement custom menu actions. To keep the answer simple, how would I achieve this example. I want to click a menu button…
JoeBayLD
  • 939
  • 2
  • 10
  • 25
3
votes
1 answer

What does the `.title` property in `NSMenu` exist for?

I'm now building up a menu bar app in Cocoa, and uses NSMenu instance to assign to the .menu property of NSStatusItem. However, NSMenu is initiated by calling NSMenu(title: ) class method, while I don't know where the .title property is used in my…
Blaszard
  • 30,954
  • 51
  • 153
  • 233
3
votes
1 answer

How don't allow "Text Only" mode for NSToolbar?

I have following menu for my toolbar: Is it any simple way to exclude "Text Only" from this menu? I know it NSToolbarDisplayModeLabelOnly, but did not found place to say don't use it.
Volodymyr B.
  • 3,369
  • 2
  • 30
  • 48
3
votes
1 answer

Hiding the dock icon without hiding the menu bar

I use the ideas in this thread to hide the dock icon of my app optionally. If the dock icon is shown after all, the menu bar should be shown too. Only with Jiulong's answer I haven't been able to make this work. The menu bar is still hidden. So…
3
votes
1 answer

How to set NSPopUpButton's menu's position?

I need to set a custom position to the NSMenu of a NSPopUpButton object. The default position looks like this: But I want it to look like this:
gabriel_vincent
  • 1,230
  • 3
  • 16
  • 35
3
votes
1 answer

NSMenuDelegate not called for submenu in NSMenuItem created by another NSMenuDelegate

I have an NSStatusItem with an NSMenu that has a delegate. This delegate dynamically updates the menu based on a few factors. So per the documentation, to quickly update the menu, I use the method: - (BOOL)menu:(NSMenu *)menu updateItem:(NSMenuItem…
Joe Mizzi
  • 236
  • 2
  • 8
3
votes
2 answers

NSMenuDelegate methods not called for contextual menu

I have a Document based application. I want to add a contextual menu that displays context-sensitive info when the user right-clicks selected text in an NSTextView. I have followed the advice in the Apple documentation and Added an NSMenu as a…
shebang
  • 1,655
  • 1
  • 12
  • 12
3
votes
1 answer

How to associate an action to a keyboard shortcut?

I've an IBAction that calls up a panel. I want to invoke that action with a keyboard shortcut but I'm at a loss on how to do it. I guess one way of doing it would be to create a menu item, associate the action to the item and then assign the…
ruipacheco
  • 15,025
  • 19
  • 82
  • 138
3
votes
1 answer

Mac OSX NSStatusItem with Custom NSMenu/MenuItems AND Drag And Drop functionality

I am trying to create a Mac Application that has an NSStatusItem icon in the Status Bar. The status bar icon should support file drag and drop and must also show a menu when clicked. The problem is that I have managed to achieve both functionalities…
Shumais Ul Haq
  • 1,427
  • 1
  • 15
  • 26