• 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: NSColor opacity
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSColor opacity


  • Subject: Re: NSColor opacity
  • From: Uli Kusterer <email@hidden>
  • Date: Sun, 25 Feb 2007 22:01:46 +0100

Am 30.01.2007 um 05:53 schrieb Ken Tozier:
NSRectFill([self bounds]);

That's your error. In 99% of the cases where I see people using NSRectFill(), it's a mistake. NSRectFill() is for "erasing". I.e. it actually assigns exactly the color you specify to the back buffer. If your window is opaque (no setOpaque:NO) that means it gets black.


 What you want is

	[NSBezierPath fillRect: [self bounds]];

That will composite the colour into what's already in the window.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: NSColor opacity
      • From: Darkshadow <email@hidden>
  • Prev by Date: Re: Implications of changing an app's bundle identifier
  • Next by Date: Re: Implications of changing an app's bundle identifier
  • Previous by thread: Re: Dragging file promises from an NSOutlineView
  • Next by thread: Re: NSColor opacity
  • Index(es):
    • Date
    • Thread