• 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: Overiding NSButton initWithFrame: (doesn't work)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overiding NSButton initWithFrame: (doesn't work)


  • Subject: Re: Overiding NSButton initWithFrame: (doesn't work)
  • From: Darrin Filer <email@hidden>
  • Date: Fri, 1 Feb 2002 16:58:41 -0500

Came across another problem as well...

My buttons use an image with transparent corners. Thus I should be able to see brushed metal behind the rounded edges of the button. However, it shows up white instead. The image definately contains transparency since when the button is clicked down, only opaque areas of its image are darkened.

Here's the code I use to set the button's image.

[workingImage lockFocus];
[sourceImage drawInRect:leftSourceRect fromRect:leftSourceRect operation:NSCompositeSourceOver fraction:1];
[sourceImage drawInRect:middleDestRect fromRect:middleSourceRect operation:NSCompositeSourceOver fraction:1];
[sourceImage drawInRect:rightDestRect fromRect:rightSourceRect operation:NSCompositeSourceOver fraction:1];
[workingImage unlockFocus];
[self setImage:workingImage];

I've even overridden isOpaque like this:
- (BOOL)isOpaque { return FALSE; }


  • Prev by Date: Re: reading in text files
  • Next by Date: Re: optimizing compilers
  • Previous by thread: Re: Sliding tab-pages in ProjectBuilder: custom subclass?
  • Next by thread: Re: Overiding NSButton initWithFrame: (doesn't work)
  • Index(es):
    • Date
    • Thread