Re: How to set the foreground and background colors of selected text in a field editor (NSTextView)?
Re: How to set the foreground and background colors of selected text in a field editor (NSTextView)?
- Subject: Re: How to set the foreground and background colors of selected text in a field editor (NSTextView)?
- From: Michael Crawford <email@hidden>
- Date: Tue, 10 Apr 2012 17:28:27 -0400
Little confused by Stephane's comments. From what I've read, the text-field is swapped out with the field editor by the window containing the text-field. This happens when the text-field becomes the first-responder. So the actual control involved is an NSTextView instanced not an NSTextField instance. The trick seems to be to get the right instance of NSTextView and set its attributes in order to get desired the selected text colors.
-Michael
On Apr 10, 2012, at 4:44 PM, Stephane Sudre wrote:
> With the delegate method, you get the appropriate NSTextView field
> editor. The issue is that you're not editing this NSTextView, you're
> editing the NSTextField.
>
> At least that's my take on this.
>
> On Tue, Apr 10, 2012 at 12:09 PM, Kyle Sluder <email@hidden> wrote:
>> On Apr 10, 2012, at 11:29 AM, Stephane Sudre wrote:
>>
>>> Allowing rich text, subclassing NSTextField and add some methods from
>>> NSTextView did not work so far.
>>
>> Subclassing NSTextField and implemented -setUpFieldEditor didn't do the trick?
>>
>> --Kyle Sluder
_______________________________________________
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