• 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
Transparent Button
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Transparent Button


  • Subject: Transparent Button
  • From: Darrin Filer <email@hidden>
  • Date: Mon, 4 Feb 2002 15:29:37 -0500

I've created some buttons that have rather complicated images which upate everytime the button changes size. Some of this button should be transparent but it isn't...

I've done a billion different things but can't get the underlying background image to display properly. The debugger shows my image with alpha set to yes. Also, when held down, the button properly highlights the opaque portions of its image. This makes me pretty sure that the image is properly loaded and transparent.

The button returns FALSE from isOpaque. (overrides NSView)
The button's cell returns FALSE from isOpaque (overrides NSButtonCell)

When Enabled (transparent) is unchecked in IB, the button displays pin stripes even though the underlying window has a background image. Also, things placed behind the button in IB are also overlaid by the pinstripe area.

My best lead so far is that the buttonCell's isOpaque routine never fires. This makes me think that my button never actually uses my custom cell even though I override the buttons cellClass method like such:

+ (Class) cellClass
{
return [DFTransparentButtonCell class];
}

Unfortunately, this method is never called... ?

Doesn't seem like it should be this hard to have a button be transparent where its image is transparent! What am I missing?


  • Follow-Ups:
    • Re: Transparent Button
      • From: André Lipinski <email@hidden>
  • Prev by Date: Re: Offscreen Drawing, NSView-Quartz-Mix
  • Next by Date: Re: Saving a RTFD-file with NSAttributedString
  • Previous by thread: Re: Converting Cocoa Menus to Carbon Menus and vice versa
  • Next by thread: Re: Transparent Button
  • Index(es):
    • Date
    • Thread