There's a typo in your image names. Use NSGoLeftTemplate and NSGoRightTemplate ("Go" instead of "Co").

On 2009-07-26, at 6:08 AM, Alexander Bokovikov wrote:

Hi, All,

I'm trying to create a simple switch button, showing something like "Show blablabla >" / "< Hide blablabla" depending on the state of "blablabla". I've found that it would be most suitable to use rounded textrured button and change its title, image and image position in the onClick: handler. Everything is OK, but I can't find how to set an image from template, which we can see in the IB. We can choose several images there, in particular, I've chosen NSCoLeftTemplate and NSCoRightTemplate for button states. But how to change them in runtime? As far as I can understand, I should write something like this:

[myButton setImage:[NSImage .........]]

but the question is what messages to use here and how to reach those templates, as we can see in the IB?

I tried imageNamed, but it does not find an image. I tried to search in Google for NSCoLeftTemplate / NSCoRightTemplate, but they're not found.

Thanks.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to