Re: re Hiding controls and another question
Re: re Hiding controls and another question
- Subject: Re: re Hiding controls and another question
- From: Timothy Ritchey <email@hidden>
- Date: Fri, 1 Mar 2002 08:05:15 -0500
While I'm asking is there any way to make a picture stretch to fit in a
button?? (also simple in Carbon)
not tested, but something like this should do it. Subclass NSButtonCell,
and override the drawInteriorWithFrame:inView:
- (void)drawInteriorWithFrame:aRect inView:aView
{
NSSize size = [[self image] size];
[[self image] drawInRect:aRect
fromRect:NSMakeRect(0,0,size.width,
size.height)
operation:NSCompositeSourceOver // <-- or
whatever op you want
fraction:1.0];
}
If the two rectangles are not the same size, the image will be
stretched, shrunk, whatever.
- tim
_______________________________________________
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.