• 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: How an I get an NSAttributedString into an NSView?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How an I get an NSAttributedString into an NSView?


  • Subject: Re: How an I get an NSAttributedString into an NSView?
  • From: Charles Steinman <email@hidden>
  • Date: Wed, 10 Oct 2007 17:08:55 -0700 (PDT)

--- Lorenzo Thurman <email@hidden> wrote:

> I have a NSStatusItem that displays the weather
> forecast. I use an
> image of the current conditions (sunny, partly
> cloudy, etc) and an
> NSAttributedString to display the current
> temperature in the status
> bar using NSStatusItem's setImage and
> setAttributedTitle methods. Now
> I would like to animate the status item when the
> forecast changes. I
> need to animate a view, so now I have to use setView
> to create a
> view. Using the image by itself in the view is easy
> enough, but how
> do get the attr. string in a view? I'm looking at
> the CircleView
> example and that looks promising as a model, but is
> there a better
> way that I might accomplish this?
> Thanks

Easiest solution: AppKit's NSAttributedString category
includes methods for drawing an attributed string in a
given rect.

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSAttributedString_AppKitAdditions/Reference/Reference.html

Cheers,
Chuck


      ____________________________________________________________________________________
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html



_______________________________________________

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

  • Follow-Ups:
    • Re: How an I get an NSAttributedString into an NSView?
      • From: Lorenzo Thurman <email@hidden>
References: 
 >How an I get an NSAttributedString into an NSView? (From: Lorenzo Thurman <email@hidden>)

  • Prev by Date: Re: display int in cocoa
  • Next by Date: Re: NSAutoreleasePool and static data member constructors
  • Previous by thread: How an I get an NSAttributedString into an NSView?
  • Next by thread: Re: How an I get an NSAttributedString into an NSView?
  • Index(es):
    • Date
    • Thread