• 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
OK, but what do 'attributes' look like?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

OK, but what do 'attributes' look like?


  • Subject: OK, but what do 'attributes' look like?
  • From: Denis Stanton <email@hidden>
  • Date: Tue, 9 Mar 2004 17:11:37 +1300

can some one help me out with understanding the Cocoa documentation? I
think this is one of those things that is considered so obvious that
the worthy documenters never bother to write it down.

I just want to write some text into a rectangle, using a smaller font
size than the default.

The method I'm trying to use is defined for NSString.

------------------------------------------------------------------------
------------------------------------------
drawInRect:withAttributes:

- (void) drawInRect: (NSRect) aRect withAttributes: (NSDictionary *)
attributes
Draws the receiver with the font and other display characteristics of
attributes , within aRect in the currently focused NSView.
------------------------------------------------------------------------
------------------------------------------

That's great, but it doesn't give me any idea what "attributes" looks
like. I see that it is a dictionary, and I know that I want it to
specify a font name and a size, but what key names should I use to
construct this dictionary? I've tried Google and come up with half a
dozen repetitions of the information above, but none of them has a link
to a definition of 'attributes".

I wish this sort of documentation would include an example. For me,
one line of code I can understand, copy and modify is worth so much
more than a formal definition that uses terms that are not in
themselves defined.

Denis

Denis Stanton
email@hidden
Home: +64 9 533 0391
mobile: +64 21 1433622
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Please don't use "reply" to start threads.
      • From: Alastair Houghton <email@hidden>
    • Re: OK, but what do 'attributes' look like?
      • From: mmalcolm crawford <email@hidden>
    • Re: OK, but what do 'attributes' look like?
      • From: Dave Keck <email@hidden>
References: 
 >Re: [OT] Apple Developer Certification (From: Chuck Soper <email@hidden>)

  • Prev by Date: Re: NSMutableArray morphs itself into an NSArray?
  • Next by Date: Help with linking to a static library
  • Previous by thread: Re: [OT] Apple Developer Certification
  • Next by thread: Re: OK, but what do 'attributes' look like?
  • Index(es):
    • Date
    • Thread