nsmenuitem Questions
4
From NSMenuItem Class Reference
If you want to specify the Backspace key as the key equivalent for a menu item, use a single character string with NSBackspaceCharacter (defined in NSText.h as 0x08...
Imitate asked 22/8, 2013 at 16:18
5
I am trying to change the titles of some of the items in my Cocoa app's main menu. I have tried setting them both within IB and also programmatically from my app's applicationDidFinishLaunchingWith...
Badenpowell asked 11/2, 2011 at 3:52
3
Solved
I have an app that sits in the menu bar, and when you click on the button it presents an NSPopover.
That all works fine, but I want an NSSearchField to become the first responder, so a user can th...
Firelock asked 15/6, 2016 at 23:28
3
Solved
I didn't use storyboard and xib, just used only code.
I would like to add "Edit" Menu Programmatically. My Questions are
1) How to show "Edit" Menu / What codes need to input at comment Question 1...
Lightner asked 28/2, 2015 at 12:59
4
Solved
How can I change the height of an NSMenuItem? When I change the font of a menu, an NSMenuItem automatically resizes to just fit the title, leaving no space above or below the title. It looks very c...
Primero asked 3/8, 2013 at 10:7
3
I have an NSMenuItem called history which resides in a NSMenu called menu. When my program starts history doesn't have a submenu so its disabled. Then at some point, I need a submenu for history, s...
Demetriusdemeyer asked 26/2, 2011 at 0:41
2
I am creating a status bar on my app and the menus show up fine, however it does not seem to access the actions that I have set up for it.
I am adding the status bar through a C function:
void M...
Glassblowing asked 17/4, 2014 at 19:1
3
Solved
I need to use a custom NSView subclass to draw some content, but it isn't drawing as highlighted when the user hovers and it doesn't dismiss the NSMenu when the user clicks on it. Any ideas?
Edit
...
Alburnum asked 27/5, 2010 at 0:14
7
Solved
To enable Copy and Paste in my Cocoa app, I added two new menu items (copy and paste) to the menu and dragged the selector from each item to the first responder (copy and paste). However, two extra...
Krawczyk asked 26/1, 2014 at 21:51
1
Solved
I am building a macOS-app using SwiftUI and the new App lifecycle.
All the default macOS menu items (like cut, copy, paste) are already there after starting a new project but they’re greyed out. Ho...
Clywd asked 31/10, 2020 at 17:5
7
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 ...
Brietta asked 8/9, 2009 at 18:31
0
macOS 11 Big Sur in its current iteration (beta 1 through beta 6) has a bug/feature that makes it hard to have NSMenuItem with the custom view. Specifically, the custom view of an item won't get a ...
Reviel asked 7/9, 2020 at 10:10
3
I would like to set the key equivalent of a menu bar item in IB to the backspace key (delete left of the cursor), but for some reason this doesn't seem to work. I can assign all kinds of keys to it...
Aesculapian asked 26/4, 2012 at 4:13
2
I have an NSTextField in my window and 4 menu items with key equivalents ←↑→↓.
When the text field is selected and I press an arrow key, I would expect the cursor to move in the text field but ins...
Syllabogram asked 16/5, 2020 at 16:11
5
Solved
I want to set key equivalent " "(space) without any modifiers for NSMenuItem (in App Main Menu).
As follows from documentation:
For example, in an application that plays media, the Play ...
Kemeny asked 22/6, 2012 at 11:22
4
Solved
I have created a simple NSStatusBar with a NSMenu set as the menu. I have also added a few NSMenuItems to this menu, which work fine (including selectors and highlighting) but as soon as I add a cu...
Lengthy asked 19/5, 2011 at 5:45
3
Solved
Here is the thing:
I have created a custom NSMenuItem with a custom NSView in it.
Everything works fine except that I can't get the NSMenuItem to get highlighted (= change the background color o...
Copywriter asked 12/7, 2013 at 0:38
2
Solved
My Mac app has an NSMenu whose delegate functions validateMenuItem and menuWillOpen are never called. So far none of the solutions online have helped.
It seems like I'm doing everything right:
T...
Nitrate asked 19/7, 2016 at 14:31
3
Solved
I'm writing a plugin for application - custom keyboard shortcut. I can traverse through its views.
I need to open popup menu, select item in it, then open its submenu and select some item in submen...
Lugger asked 5/2, 2014 at 16:58
1
Solved
I am trying to set up some simple services on a Mac using a menubar/status script with applescript.
After having read the web up and down, bearing in mind I am new to scripting, it seems I have rea...
Slope asked 23/3, 2018 at 1:29
2
Solved
I have an NSMenu in Interface Builder that is connected to an NSTableView's menu outlet.
I want to assign Key Equivalents to the items in this menu so the user doesn't have to right click, but the...
Bing asked 30/11, 2012 at 12:27
1
I'm working on a menu bar app, and I'm setting a custom view using NSMenuItem's view property.
The view displays ok, but I'm unable to receive any kind of mouse click events for menu items that ha...
Omeromero asked 13/6, 2017 at 17:18
8
Solved
I have subclassed NSMenu and connected a bunch of NSMenuItem's via Interface Builder. I have tested via the debugger to see that they really get initialized.
The menu is set to not auto enable ite...
Quicken asked 20/2, 2012 at 21:26
1
Solved
I have a NSMenuItem that has a keyboard shortcut.
I set the shortcut like this:
// Close
let closeItem = NSMenuItem()
closeItem.title = Resources.QUIT
closeItem.action = #selector(quit)
close...
Eta asked 5/4, 2017 at 16:56
1
Solved
I have an NSToolbarItem with an NSButton as its view and an NSMenuItem in the main menu. Both have the same action, which is sent to the first responder, not to a particular target. That method is ...
Acosmism asked 26/2, 2017 at 15:49
1 Next >
© 2022 - 2024 — McMap. All rights reserved.