Suggestions on alignment of NSAttributedString in NSView
Suggestions on alignment of NSAttributedString in NSView
- Subject: Suggestions on alignment of NSAttributedString in NSView
- From: Ron Medina Ballesteros <email@hidden>
- Date: Wed, 7 Apr 2004 21:49:14 -0700
I need some suggestions of the best way to draw a tree representation
of a hierarchy of people in a NSView where each person's name will
serve as a node in the tree.
What I have so far is each person's name is an NSAttributedString and
they are drawn in my custom view unfortunately left align but what I
want and having a hard time working out is how to properly align each
name (node) that is on the same level. For example, three names (nodes)
that have to be centered with equal spacing in between each on the same
level.
My first thought is to divide the size of the width of the nsview by
the number of names that need to be on that level. Then somehow figure
out the rect size where I can use with drawInRect: of each of the
attributed string names.
I'll still need to draw lines betwen each name(node) but I'll get there
once I figure out how to align the names.
Any suggestions would be appreciated especially if I am going about
this the long or wrong way.
Thanks.
~r
_______________________________________________
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.