Sunday, 15 May 2011

cocoa - How do I create a single line text input field for OSX? -


I am trying to create a simple text input field for the program which is only one line for OSX, no scroll Not a bar and automatically scrolls right and left when the user type and cursor I have tried to use a NSTextField, but it always seems to be the multi-line. I have found the following link which seems to solve this issue but it does not work for me.

I am creating NSTextField, add it to my view and set the 'set signalline mode' to set NSCL 'yes', but the text field still wraps the text when I scrolling instead of reaching the end of the field.

I have tried using NSTcrollView with NSTextView and nearby, but in this case I can not take it to scroll horizontally or vertically.

If someone can tell me in the right direction, then it will be highly appreciated.

Thank you.

This is Eclipse SWT, it should be easy to translate from Java to Objective:

  NSTextField widget = new NSTextField () .alloc (); Widget.init (); NSCL cell = widgets (); Cell.setWraps (wrong); Cell.setScrollable (true);    

No comments:

Post a Comment