• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: newbie question: how to get small icon in NSButton?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >newbie question: how to get small icon in NSButton? (From: Jay Koutavas <email@hidden>)

  • Prev by Date: newbie question: how to get small icon in NSButton?
  • Next by Date: Re: OT: WWDC
  • Previous by thread: newbie question: how to get small icon in NSButton?
  • Next by thread: Slow NSTableView
  • Index(es):
    • Date
    • Thread