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

Re: OK, but what do 'attributes' look like?


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

Briefly, because my last mail is better response and thanks for the help

On Tuesday, March 9, 2004, at 07:31 PM, mmalcolm crawford wrote:

This appears to tell me that I am free to think up any name value pair I want to.

Yes, that's exactly what it means.

"You can assign any attribute name/value pair you wish ". This doesn't make sense to me. Surely for the text to appear in a certain font I have to identify that font using a name that the compiler will recognise. Making up my own key value pair will not communicate anything useful.

It allows for flexibility -- suppose you wanted to mark up text with special attributes for class names. Apple hasn't provided an attribute for that, but you can create, and assign, your own...

Being allowed to make up my one language would be great - if I only wanted to talk to myself. It surprised me here, because I actually want to communicate something to the compiler, and it seems only logical that I should use a terms that it will recognise. I understand that the flexibility is providing for more complex needs, where I might be handing the output myself.

Yes, I went there. I found:
Attribute Identifier NSFontAttributeName
Default Value Helvetica 12-point

I'm not sure why you skipped the Value Class -- NSFont?

Because I didn't understand what this column was for. I'm looking for a way to do something to an NSString, but the only line that deals with NSString is for tool tips. I discarded the central column because it didn't match the pattern I was looking for.

What would be really nice would be just one example that works,.

NSFont *font = [NSFont systemFontOfSize:[NSFont systemFontSize]];

NSDictionary *attributes =
[NSDictionary dictionaryWithObject:font forKey: NSFontAttributeName];

Excellent! so much easier to understand than the column headed Value Class.

Thank you for your patience.

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:
    • Re: OK, but what do 'attributes' look like?
      • From: Scott Anguish <email@hidden>
    • Re: OK, but what do 'attributes' look like?
      • From: Jim Rankin <email@hidden>
References: 
 >Re: OK, but what do 'attributes' look like? (From: mmalcolm crawford <email@hidden>)

  • Prev by Date: Re: OK, but what do 'attributes' look like?
  • Next by Date: Re: agvtools killing my plists
  • Previous by thread: Re: OK, but what do 'attributes' look like?
  • Next by thread: Re: OK, but what do 'attributes' look like?
  • Index(es):
    • Date
    • Thread