Re: NSNoSelectionPlaceholderBindingOption
Re: NSNoSelectionPlaceholderBindingOption
- Subject: Re: NSNoSelectionPlaceholderBindingOption
- From: Scott Anguish <email@hidden>
- Date: Mon, 17 Apr 2006 23:31:29 -0400
You'll need to do one of the following
first, check to see if there is a no selection place holder binding
option for the specific binding using the NSKeyValueBindingCreation
method
-(NSDictionary *)infoForBinding:(NSString *)binding
and see if there is an entry in the dictionary for the no selection
place holder binding option key
if not, then try using the NSPlaceholders protocol method
+ defaultPlaceholderForMarker:withBinding:
sending it to NSTextField
On Apr 17, 2006, at 4:55 PM, Michael Link wrote:
If I have the value binding of an NSTextFieldCell subclass bound to
an array controllers selection.<key> is there a way to find out
what value an NSTextFieldCell will display if it has no selection
or has a multiple selection (that is, if the [self
attributedStringValue] returns nil)? (i.e by default the
NSNoSelectionPlaceholderBindingOption returns @"No Selection"). I'm
interested in finding the value (would be nice if it's an
attributedString) so I can calculate the frame rect for the text.
I'm doing this in the -[NSTextAttachmentCell
cellFrameForTextContainer:proposedLineFragment:glyphPosition:character
Index:] method of this cell that conforms to the
NSTextAttachmentCell protocol, because this cell is used in an
NSTextView.
I've tried subclassing -
observeValueForKeyPath:ofObject:change:context: to actually see the
selection key passed in, but it appears the cell has a helper class
actually doing the observing...
Thanks.
--
Michael _______________________________________________
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
_______________________________________________
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