Re: newbie question: how to get small icon in NSButton?
Re: newbie question: how to get small icon in NSButton?
- Subject: Re: newbie question: how to get small icon in NSButton?
- From: David Remahl <email@hidden>
- Date: Fri, 16 May 2003 22:33:55 +0200
This should do it:
NSImage *icon = [NSImage imageNamed:@"Icon"];
[icon setSize:NSMakeSize( 32.0, 32.0 )];
[button setImage:icon];
Or;
Or simply,
[[button image] setSize:NSMakeSize(32.0,32.0)];
[button setNeedsDisplay:YES];
/ Regards, David
On Friday, May 16, 2003, at 10:01 PM, Jay Koutavas wrote:
I'm laying out a 32x32 NSButton in Interface Builder and am dropping
an .icns file on it. IB (and my app naturally) comes up with the
128x128 representation of the icon, even though the .icns file I'm
using has 16x16, 32x32, and 48x48 icon representations in it. Its my
understanding that even if the .icns file didn't have the smaller
representation, Cocoa would "just do the right thing" and scale. But
it's not scaling. I've noted that the same exact .icns file scales
beautiful when given to a NSToolbarItem. The docs on NSToolbarItem
explicitly state that the icon will be scaled. So, this scaling magic
isn't inherent in NSButton? Can I use NSButton with some sort of a
programmatic piece of magic to get the scale to happen?
/Jay
_______________________________________________
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.