Transparent Button
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?