MacOSLib: NSSearchField – Focus & Backgroundcolor

I love the comfort of MacOsLib’s supported NSSearchfield, but there are two drawbacks I couldn’t find any solution for yet:

Although I have Acceptfocus and UseFocusRing set to false in Inspector (and repeat that in the open event because I thought they could somehow get overridden), the search field still displays a blue border once the cursor is inside it. Is there a way to really switch the focus ring off?

And I’d like to have a different background color for the search field. According to the docs, it is based on an NSCell, which – according to Apple’s docs – has a setbackgroundcolor method. But I cannot find any handle to it; trying to override the paint event with a filled rect did only appear in the transparent round corners sections. Do you have any clue how to paint the inside differently?

And, btw: Is there a method to automatically place the cursor inside the Searchfield when there is no content in it yet?

I’m unsure how to change the background color, but the AcceptFocus and UseFocusRing are from the canvas superclass of the NSSearchField and they will not prevent the search field from having a focus ring. This declare should disable the focus ring - put it in the NSSearchField open event:

Declare sub setFocusRingType lib CocoaLib Selector "setFocusRingType:" (obj_id as ptr, type as Integer) setFocusRingType(me,1)

Thanks a lot, Jason! Works!