Re: NSButtonCell subclass (partially transparent images)
Re: NSButtonCell subclass (partially transparent images)
- Subject: Re: NSButtonCell subclass (partially transparent images)
- From: Darrin Filer <email@hidden>
- Date: Fri, 8 Feb 2002 22:41:52 -0500
You describe exactly what I intend and anticipate. Thing is, absolutely
nothing is drawn even though these lines of code are executed.
Maybe its the same bug which causes buttons with transparent images to
render improperly in the first place. (?)
darrin filer
On Friday, February 8, 2002, at 09:38 PM, Donald Brown wrote:
I have a circular button with a little lock in it, instead of the word
"unlock". [self image] holds the picture of the lock, it does not hold
the
circular bubble. (I change the image between a closed lock and open
lock.)
Your code would copy my lock, but not the bubble around it.
Donald
on 2/8/02 8:23 PM, Darrin Filer at email@hidden wrote:
The button/buttonCell's image has been set. This can be verified from
the debugger or by simply commenting out the overridden functions. In
which case it renders normally since the subclass isn't overriding any
of NSButtonCell's methods.
The following code should draw the cell's image into its control's
view,
right? Break points are reached in this function from which I've
verified that cellFrame, controlView, and [self image] are all
reasonable values... baffling
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView {
[controlView lockFocus];
[[self image] compositeToPoint:cellFrame.origin
operation:NSCompositeCopy];
[controlView unlockFocus];
[controlView setNeedsDisplay:YES];
}
Assuming that [self image] is properly loaded, why would this code not
draw anything?
darrin filer
On Friday, February 8, 2002, at 04:59 PM, Erik M. Buck wrote:
The image that you get via [self image] is not the image of the button
itself. It is the optional image that is displayed instead of or
along
with
a title. If there is no image associated with a button then your code
will
not draw anything.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
--
Donald Brown
email@hidden
http://www.eamontales.com
We have met the enemy and he is us - Pogo
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.