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 21:23:09 -0500
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.