wits end with nsview and nsrectfill()
wits end with nsview and nsrectfill()
- Subject: wits end with nsview and nsrectfill()
- From: Navneet Kumar <email@hidden>
- Date: Sun, 30 Nov 2014 23:00:16 +0530
Hi,
I have a custom view in which I am setting the background using NSRectFill() in drawRect:. I am also adding a text field as subview in this method. The textfield is non-selectable, non-editable and is not set to draw background.
When the view comes to front, the background is same, but when it refreshes, the area apart from the text field becomes a bit darker and the text field area shows the original background, this creates a contrast which I want to get rid of.
The view is set to return YES to isOpaque.
I have tried a lot of things but to no avail.
I have tried CGContext approach to fill rect.
I also tried setting the color before NSRectFill() to a opaque color as well.
The problem is gone if I removeFromSuperview and create the custom view again and again on each drawRect: of the super view. But this consumes a lot of CPU.
An image showing the contrast is attached herewith.
Please help.
Best,
Navneet
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden