• 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: NSBox Colored Background
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBox Colored Background


  • Subject: Re: NSBox Colored Background
  • From: August Trometer <email@hidden>
  • Date: Tue, 26 Oct 2004 15:51:41 -0500

That did the trick!

For those who want to try this, I had to make the newRect dimensions quite a bit smaller for the path fill, but it looks great.

Thanks Michael!




On Oct 26, 2004, at 2:49 PM, Michael Becker wrote:

The problem is, that drawRect: is supposed to be able to draw a certain part of the view, i.e. the one specified by aRect. Now when you e.g. click a button which is in your box, it tells its superview (your custom box) to draw the rectangle where the button lies in. But because you fit a certain shape into that rectangle, you're not completely filling the buttons rectangle, which results in parts of the background showing through.

Here's a possible solution to your problem:

- (void) drawRect: (NSRect) aRect
{
aRect = [ self bounds];

NSRect newRect;
[ . . . ]

This way you always draw the entire box instead of the passed rectangle. This is theoretically slower because you always draw the whole thing, but it should not bother you, unless your box gets really(!) big and holds a lot of stuff... :-)





_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >NSBox Colored Background (From: August Trometer <email@hidden>)
 >Re: NSBox Colored Background (From: Michael Becker <email@hidden>)
 >Re: NSBox Colored Background (From: August Trometer <email@hidden>)
 >Re: NSBox Colored Background (From: Michael Becker <email@hidden>)

  • Prev by Date: Re: System Idle Time
  • Next by Date: Eliminating NSTableView selection highlighting
  • Previous by thread: Re: NSBox Colored Background
  • Next by thread: Re: NSBox Colored Background
  • Index(es):
    • Date
    • Thread