Questions tagged [nsmenuitem]

The NSMenuItem class from AppKit.framework in Mac OS, defines objects that are used as command items in menus.

The NSMenuItem class defines objects that are used as command items in menus. Additionally, the NSMenuItem class also includes some private functionality needed to maintain binary compatibility with other components of Cocoa. Because of this fact, you cannot replace the NSMenuItem class with a different class. You may, however, subclass NSMenuItem if necessary.

Prior to Mac OS X v10.5, NSMenuItem conformed to the following protocols: NSCopying, NSCoding), and NSValidatedUserInterfaceItem.

https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSMenuItem_Class/Reference/Reference.html

331 questions
0
votes
1 answer

Setting Selected Index of NSPopUpButtonCell in NSTableView

I populate a column in an NSTableView with NSPopUpButtonCell instances (just dragged such a cell to a column in IB). Everything works fine, except for one thing : when I try to set the selected item index of one of the NSPopUpButtonCell instances by…
Fatso
  • 1,278
  • 16
  • 46
0
votes
1 answer

Create SIMBL Plugin in Cocoa

I want to make a very basic SIMBL Plugin - just add a new Menu in Safari. This is what I've tried: I added this to my plist: NSPrincipalClass MySamplePlugin SIMBLTargetApplications
dehlen
  • 7,325
  • 4
  • 43
  • 71
0
votes
1 answer

sort NSPopUpMenu items alphabetically

I want to sort the NSMenuItems of a NSPopUButton alphabetically. I checked the cocoa reference and i can't find a function that does this. Am i missing something or i have to write my own sorting function? Thanks in advance
ozmax
  • 470
  • 6
  • 17
0
votes
1 answer

OS X, Why is Help NSMenuItem in NSMenu disabled after registering the Help Book?

OS X, Why is Help NSMenuItem in mainMenu disabled after registering the Help Book Tags: OSX, HelpBook, NSMenuItem, AHRegisterHelpBookWithURL The HelpBook is unusable because the Help menu is disabled. When the Help Menu is selected, the Help sub…
mbarron
  • 285
  • 4
  • 15
0
votes
2 answers

Mac app, menuitem to bring main window to front grayed out on close/minimize

I'm trying to add a menu item to show the main window. It's enabled when the window has not been minimized or closed (yellow - and red x buttons), but when it has, the menu item is grayed out. That is of course useless and silly. :) Another menu…
Henrik Erlandsson
  • 3,797
  • 5
  • 43
  • 63
0
votes
1 answer

Transparent NSMenu

I'm trying to change the opacity of a NSMenu, I made custom NSMenuItems and changed their opacity but there is still the white color of menu behinde them, I'm looking for a way too change the color and opacity of the menu background. I was wondering…
Abcd Efg
  • 2,146
  • 23
  • 41
0
votes
1 answer

NSMenu - Recent list

I need to implement a "recent list" for uploaded images like in cloudapp or droplr. So whenever i upload an image it should create a nsmenuitem with its title(or url). There should be always the last 5 uploaded images. So i think i need a plist…
dehlen
  • 7,325
  • 4
  • 43
  • 71
0
votes
1 answer

Xcode/Interface Builder Mac App Development

Well i want from the drop down menu(Menu Item List) one item to be working as an link, to open an url/website in safari - thats it. When this is so simple, why no one come up with a clue here - I tried many different ways in Xcode, with Apple Xcode…
0
votes
0 answers

How to call NSMenu validateMenuItem ?

I need dynamically enabling voice on a NSMenu. The first check is done with validateMenuItem in this way: -(BOOL)validateMenuItem:(NSMenuItem *)menuItem{ NSMenuItem *item = [self.menu itemAtIndex:0]; if(menuItem == item){ return…
MatterGoal
  • 16,038
  • 19
  • 109
  • 186
0
votes
2 answers

Popped Up NSMenu Always Highlights First NSMenuItem

I have an NSButton that when clicked calls [NSMenu popUpMenuPositioningItem:atLocation:inView:]. The menu pops up in the proper location however the topmost NSMenuItem is always highlighted blue, as if the mouse was hovering over it, except that…
Carter
  • 4,738
  • 2
  • 22
  • 24
0
votes
2 answers

NSMenuItem Title Set to String and NSString?

So basically I have an IBoutlet NSMenuItem called localIP. I am using the setTitle instance in my .m and I want to set the title equal to a string (@"") and an NSString. Look at the following fragment. [localIP setTitle:(@"Local IP: %@",…
Andrew Sheridan
  • 19
  • 1
  • 10
-1
votes
1 answer

Adding NSMenuItem to NSApp.MainMenu not inserting new menu item

I'm using the following code to add a new menu item programatically override func viewDidLoad() { let mainMenu = NSApp.mainMenu let myMenu = NSMenuItem(title: "MenuTitle", action: nil, keyEquivalent: "") mainMenu!.addItem(myMenu) } But…
techno
  • 6,100
  • 16
  • 86
  • 192
-1
votes
1 answer

Collecting keyboard shortcuts for menu items of another application

I'm writing an application that allows access to other applications' menu items via the accessibility framework. I have no problem obtaining the list of menus, their menu items, etc.. As far as I can see, however, the accessibility framework does…
Frank R.
  • 2,328
  • 1
  • 24
  • 44
-1
votes
2 answers

macOS - Menu actions do not trigger any action if the app is not active

I am building this app that will sit on the menu bar. So, as normally is done with this kind of app, you adjust the statusItem menu to be the menu of your app. The items on that menu trigger actions on the first responder, that in my case is the…
Duck
  • 34,902
  • 47
  • 248
  • 470
-1
votes
1 answer

NSAppleScript Returned Value

How do I get the returned value from an NSAppleScript. I am using apple script to get the song title in iTunes and take that value and set NSMenuItem's title. My code: .M //run applescript NSAppleScript *script = [[NSAppleScript alloc]…
atomikpanda
  • 1,845
  • 5
  • 33
  • 47
1 2 3
22
23