I am not sure if this really qualifies as a bug, but I wanted to report it anyways, because I can imagine other people running into this problem as well.
If you generate a new application using the capp gen NibApplication template and afterwards in InterfaceBuilder remove the menu bar from your NIB file, paste and cut wont work any longer with CPTextField. Cmd-V and Cmd-X should invoke the paste: and cut: messages of CPTextField but this only works as long as the menu bar with its Paste and Cut menu items exists. And without invoking the paste: and cut: messages CPTextField wont send its textDidBeginEditing, textDidChange, ... notifications, which is a big problem if you are using bindings.
A simple workaround would be to manually add the key bindings in applicationDidFinishLaunching:
// This is called when the application is done loading.
[CPKeyBinding cacheKeyBinding:[[CPKeyBinding alloc] initWithPhysicalKeyString:@"@v" selectors:[CPArray arrayWithObject:@"paste:"]]];
[CPKeyBinding cacheKeyBinding:[[CPKeyBinding alloc] initWithPhysicalKeyString:@"@x" selectors:[CPArray arrayWithObject:@"cut:"]]];
After this paste and cut works as it should.
Labels: #needs-patch, #new, AppKit, bug. What's next? This issue needs a volunteer to write and submit code to address it.
this bug most likely is also responsible for the lack of Cmd-N opening a new browser window without a menu (confirmed for Safari and FF).
Actually in Cocoa I'm pretty sure that if you remove the menu entirely of an app, cut and paste no longer works at all.
just curious, why is is browser-native shortcut new window (cmd-N) also blocked without menu?
this results in the user beeing locked in, certainly not expected behaviour.
thanks ross, adding empty menu + [CPMenu setMenuBarVisible:NO] fixed the cmd-N issue for me. best greetings, daniel
Has this issue been fixed with #1757?
Milestone: 0.9.7. Labels: #needs-patch, AppKit, bug. What's next? This issue needs a volunteer to write and submit code to address it.
I have just tested this by creating a new NibApplication and deleting the menubar. Cmd-V works to paste into a CPTextField.
Milestone: 0.9.7. Labels: #fixed, AppKit, bug. What's next? This issue is considered successfully resolved.