Positioning a string
Positioning a string
- Subject: Positioning a string
- From: Julio Cesar Silva dos Santos <email@hidden>
- Date: Mon, 30 Jan 2006 20:00:19 -0200
I am experiencing a little trouble with a string I want to draw in an
NSRect and as the coordinates in Cocoa are upside-down I am totally
confused. This string has a variable height but I want to put it
always on the same point from the top of outerSize:
NSSize outerSize = [self bounds].size;
NSSize stringSize = [theString sizeWithAttributes:stringAttrib];
NSPoint stringPoint = NSMakePoint(fixedWidth, fixedHeight);
[theString drawAtPoint:stringPoint withAttributes:stringAttrib];
What is the calculation that I must do to get fixedHeight say, 32
pixels from top? I know, this is basic but I do not get it.
Thanks for any help,
Julio Cesar Santos
email@hidden
eMac 1GHz ComboDrive
640MB RAM
Linux User #359973
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden