how to make NSTextField really single line?
I created a text field programmatically. when the return key is pressed, all text is selected. but I can still paste multiple lines of text. And when I press Arrow-right or Arrow down, it scroll to the next line.
There aren't these issues if I use IB and set the "use single line mode", but I couldn't find the right method to set it programmatically.
Have you tried telling the field's cell to set whether it uses single-line mode?
This works for me when programmatically creating controls:
Keep in mind that direct access to NSControl's cell has been discouraged since OS X 10.10 introduction:
https://developer.apple.com/library/mac/releasenotes/AppKit/RN-AppKit/