Execute an Action when the Enter-Key is pressed in a NSTextField?

后端 未结 8 1952
野的像风
野的像风 2020-12-02 06:23

I have a small problem right now. I want to execute a method when the Enter key is pressed in a NSTextField. The user should be able to enter his data and a calculation meth

8条回答
  •  隐瞒了意图╮
    2020-12-02 06:52

    NSTextFieldDelegate's – control:textView:doCommandBySelector: is your friend.

    Look for the insertNewline: command.

提交回复
热议问题