开发者

NSView in NSMenu -- how to make "key" for accepting keyboard commands [specifically, return]

开发者 https://www.devze.com 2022-12-13 13:42 出处:网络
I have a text field and a button living in a view inside a menu item. The button submits the string in the text field to a function, and that works fine. However, I\'ve also set the button\'s key equi

I have a text field and a button living in a view inside a menu item. The button submits the string in the text field to a function, and that works fine. However, I've also set the button's key equivalent to "return." The key command isn't being picked up, prob开发者_如何学Pythonably because the menu is not the "key" window.

I know how to make a window the key window (makeKeyAndOrderFront) -- what's the equivalent for a view living in a menu?

0

精彩评论

暂无评论...
验证码 换一张
取 消