• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: wits end with nsview and nsrectfill()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: wits end with nsview and nsrectfill()


  • Subject: Re: wits end with nsview and nsrectfill()
  • From: Uli Kusterer <email@hidden>
  • Date: Fri, 05 Dec 2014 13:30:11 +0100

On 30 Nov 2014, at 18:30, Navneet Kumar <email@hidden> wrote:
> I have a custom view in which I am setting the background using NSRectFill()

 What is the current compositing mode set on the current graphics context? Have you tried using NSRectFillUsingOperation() and passing NSCompositeCopy to make sure you didn't somehow screw up the current compositing operation setting?

> 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.

 *never* change the view hierarchy in drawRect:. That may work by accident, if you get lucky, but as, while you are inside drawRect:, your parent view is iterating over its subviews, you'll be screwing its state up. It might crash, it might draw one view twice, or seem to skip one.

> 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.

-- Uli
_______________________________________________

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


  • Follow-Ups:
    • Re: wits end with nsview and nsrectfill()
      • From: Uli Kusterer <email@hidden>
  • Prev by Date: Re: wits end with nsview and nsrectfill()
  • Next by Date: Re: wits end with nsview and nsrectfill()
  • Previous by thread: Re: wits end with nsview and nsrectfill()
  • Next by thread: Re: wits end with nsview and nsrectfill()
  • Index(es):
    • Date
    • Thread