• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Transparent NSMutableAttributedString
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transparent NSMutableAttributedString


  • Subject: Re: Transparent NSMutableAttributedString
  • From: Lorenzo <email@hidden>
  • Date: Thu, 17 Feb 2005 15:35:29 +0100

I don't need to copy or save the string. I need just to apply the same
transparency programmatically the string in the NSTextView. I use to apply
color to a string then I put the string into the view, but if I use alpha
differet than 1, it doesn't feel it. It consider alpha always 1. Look

    fontColor = [NSColor colorWithDeviceRed:1.0f  green:1.0f  blue:1.0f
                                      alpha:0.1f];
   [stringAttrib setObject:fontColor forKey:NSForegroundColorAttributeName];

with alpha 0.1, nothing happens. It's like the alpha is always 1.0.
Instead, if the user applys to the string a tranparent color using the color
panel, the string gets the transparency. Why?


Best Regards
--
Lorenzo
email: email@hidden

> From: "John C. Warner" <email@hidden>
> Date: Thu, 17 Feb 2005 08:27:04 -0500
> To: Lorenzo <email@hidden>
> Cc: email@hidden
> Subject: Re: Transparent NSMutableAttributedString
>
>
> On 17 Feb, 2005, at 2:28 AM, Lorenzo wrote:
>
>> Hi,
>> in my transparent window, with a transparent NSTextView I can select a
>> string and assign to it a 50% alpha color. So the string looks like
>> half-transparent at that moment. Good.
>> Anyway, if I copy that string and paste it somewhere else in the same
>> NSTextView, the string becomes opaque again. And if I save and load the
>> string to/from a file, it looses the transparency again. So, my
>> question is,
>> how to keep the transparency color of the text?
>
> NSAttributedStirng uses RTF as transport for going through the
> pasteboard. I don't believe RTF has any support for transparency. You
> could try putting it on as PDF or a image, but then obviously you lose
> editability. Or you could make your own pasteboard type, but other
> applications won't understand it.
>
> -John
>

 _______________________________________________
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

References: 
 >Re: Transparent NSMutableAttributedString (From: "John C. Warner" <email@hidden>)

  • Prev by Date: Re: Creating NSViews with code.
  • Next by Date: Re: Creating NSViews with code.
  • Previous by thread: Re: Transparent NSMutableAttributedString
  • Next by thread: buddy icon
  • Index(es):
    • Date
    • Thread