Question

Here's an image of an NSPredicateEditor in one of my apps:

NSPredicateEditor

What I'd like to do is stop the class from drawing the grey background in each row and the "separator" lines between rows, leaving just the popup buttons, textfields and text in each row. After much googling and various attempts to hack the class, I haven't found a way to do this.

I AM aware of another, similar question about NSPredicateEditor on SO, but that person wanted to draw custom, alternating rows. I'm hoping someone might have a trick to simply stop the background drawing altogether.

Thanks!

Was it helpful?

Solution

To prevent the drawing of separator lines in the NSPredicateEditor, just use this extremely simple sub class (Swift 4):

import Cocoa

class PredicateEditor: NSPredicateEditor {
    override func draw(_ dirtyRect: NSRect) {}
}

OTHER TIPS

Unfortunately, there's no way to do this. :(

I suggest that you file an enhancement request at https://bugreport.apple.com.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top