> On May 31, 2017, at 2:18 PM, J.E. Schotsman <[email protected]> wrote: > >> On 31 May 2017, at 20:59, Charles Srstka <[email protected] >> <mailto:[email protected]>> wrote: >> >> Does setting its needsDisplay property to true have any effect? >> >> Charles > > No. I’ve also tried > > myTextField.superview!.setNeedsDisplay( myTextField.frame ) > > in order to get the background redrawn but again I keep seeing the white text > background.
Try setting isBordered and isBezeled to false as well and you should probably get a clear background. Note that this won’t work if the insertion point is in the text field, because when that’s the case, you’re actually seeing the field editor, not the text field, and the field editor will still have the white background. So you probably want to end editding first. If you’re using bindings to populate the field, this is easy; just send commitEditing() to the NSObjectController or NSViewController that the text field is bound to. Otherwise, you’ll have to do it the old-fashioned way with NSWindow.makeFirstResponder(_:) (or NSWindow.endEditing(for:) if that won’t work for whatever reason). Charles _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
