NSButton setImage in runtime : where is template image?
NSButton setImage in runtime : where is template image?
- Subject: NSButton setImage in runtime : where is template image?
- From: Alexander Bokovikov <email@hidden>
- Date: Sun, 26 Jul 2009 16:08:11 +0600
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 (email@hidden)
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:
This email sent to email@hidden