Re: How to use NSImageView bindings placeholders?
Re: How to use NSImageView bindings placeholders?
- Subject: Re: How to use NSImageView bindings placeholders?
- From: Fritz Anderson <email@hidden>
- Date: Wed, 8 Feb 2006 12:32:53 -0600
On 3 Feb 2006, at 9:28 AM, Guy Umbright wrote:
I have an NSImageView with the 'valuePath' binding set and it works
as expected when the path
points to a graphic file. What I would like is a default graphic
be displayed when the path is not
a graphic file. Would the 'Not applicable' binding be of use
here? If so how? The bindings reference
say the value should be an NSNumber, but how would that be
meaningful? A pointer to an NSImage
(set programatically)?
Guy,
In the January 2006 version of the developer documentation,
NSImageView bindings list valuePath as a string.
I'd try an NSValueTransformer that validates the proposed path and
returns nil (or, better, the path to the bundle's default picture
file) if it doesn't point to a graphic. If you go with returning nil,
specify (possibly at awakeFromNib time) the default picture for the
null-value condition.
-- F
--
Fritz Anderson -- http://www.manoverboard.org/
Consulting Programmer -- http://resume.manoverboard.org/
Step into Xcode, Now Available -- http://six.manoverboard.org/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden