OK, but what do 'attributes' look like?
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.