Re: OK, but what do 'attributes' look like?
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:31:21 +1300
Hi Dave, mmalc, Scott and Dave (boy we have some power behind my dumb
question! thanks guys)
On Tuesday, March 9, 2004, at 06:43 PM, Scott Anguish wrote:
You're not quite there yet..
true
Look at the constants table in the NSAttributed Strings additions here
http://developer.apple.com/documentation/Cocoa/Reference/
ApplicationKit/ObjC_classic/Classes/NSAttributedString.html#//
apple_ref/doc/uid/20000167
Yes, been there.
specifically, the middle column tells you the object type
And..... what does that tell me....? Type of which object? I'm
working on setting attributes for an NSString, but the only line that
mentions NSString in the middle column is something about tool tips.
Nearly there, but I'm back to the same situation. The documentation is
clear and obvious, if you know the answer,
On Tuesday, March 9, 2004, at 06:54 PM, Dave Rosborough wrote:
You need to have an NSFont as the object for the NSFontAttributeName
key...
OK, that's what Scott was hinting at, except that I didn't catch on.
So the object submitted to the dictionary has to be of this type.
Getting closer....
Try this:
[myString drawInRect:myRect withAttributes:[NSDictionary
dictionaryWithObject:[NSFont fontWithName:@"Helvetica" size:9.0]
forKey:NSFontAttributeName]];
Horray! an actual example. Got it immediately and my code is now
working
I guess one of the problems with being self-taught (OK, you can blame
the teacher) is I don't recognise the formal definitions and standard
terms so easily. I saw a column on that page that I had found, and you
each referred me to, headed "Value Class", but I did not appreciate
that the cryptic heading meant "The object that you add to the
attribute dictionary must be of the type listed below".
Thanks all for your time. I hope I haven't wasted too much. As I know
at least two of you are in the business of explaining things to
beginners I thought I would try to show how this beginner at least was
just not getting, it despite reading the same document as the rest of
you.
regards
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.