Custom NSTextField Single line

With modified code from Jim Mckay’s NSSearchfield, i’ve got a custom nstextfield with preferred background & border. The only thing that is a bit irritating is that it behaves like a multiline and some of the text from previous lines is shown when selecting the text.

I wan’t it to behave like a single line.

I found this code.

[myTextField.cell setUsesSingleLineMode:YES]; 

  Declare sub setUsesSingleLineMode lib CocoaLib Selector "setUsesSingleLineMode:" (obj_id as Ptr, value as Boolean)
  setUsesSingleLineMode(cell(myNSTextField), true)

Does this look correct, is there anything else I should also be setting?

Found the answer myself. Needed these two as well.

  declare sub setWraps lib CocoaLib Selector "setWraps:" (obj_id as Ptr, value as Boolean)
  setWraps(cell(myNSTextField), false)
  
  declare sub setScrollable lib CocoaLib Selector "setScrollable:" (obj_id as Ptr, value as Boolean)
  setScrollable(cell(myNSTextField), true)