Re: NSButtonCell subclass (partially transparent images)
Re: NSButtonCell subclass (partially transparent images)
- Subject: Re: NSButtonCell subclass (partially transparent images)
- From: "Erik M. Buck" <email@hidden>
- Date: Fri, 8 Feb 2002 20:53:52 -0600
- Organization: EMB & Assocites Inc.
I have annotated your code:
>
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
>
*)controlView {
>
[controlView lockFocus]; // NOT NEEDED
>
[[self image] compositeToPoint:cellFrame.origin
>
operation:NSCompositeCopy];
>
[controlView unlockFocus]; // NOT NEEDED
>
[controlView setNeedsDisplay:YES]; // NOT NEEDED
>
}
>
>
Assuming that [self image] is properly loaded, why would this code not
>
draw anything?
if [self image] returns non-nil and cellFrame.origin is in the visible
portion of controlView and drawInteriorWithFrame:inView: is actually being
called then it should draw the image.
See
http://www.stepwise.com/Articles/Technical/NSCell.html
_______________________________________________
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.