How to: Address Book-like text UI
How to: Address Book-like text UI
- Subject: How to: Address Book-like text UI
- From: Kai BrĂ¼ning <email@hidden>
- Date: Wed, 5 Sep 2007 09:38:10 +0200
Good morning!
I want to create a view with similar behavior to the Address Book
card view: text blocks are positioned in the view under program
control, but can be selected as a continuous text (unless in edit
mode). Of course I want to use the Cocoa text system.
My understanding so far is as follows:
To enable the continuous selection, all text has to be in a single
NSTextStorage object.
My first idea to control the placement of text blocks was to use one
NSTextContainer per block (as suggested in the documentation e.g. for
multi column layouts). Unfortunately I did not find a means so far to
control the amount of text which is layed out in a text container.
That is, NSLayoutManager seems to always fill a text container, while
I need to assign a pre-determined piece of text to each container. Is
there a way to tell NSLayoutManager to move to the next text
container at a defined point in the text (as would be needed for
forced page breaks or column breaks in more traditional layout)?
Another way would be to use a subclass of NSTextBlock. This should
work well, but since NSTextBlock is available beginning with Tiger
only, Address Book must be using another approach (at least in the
past).
Any advice would be appreciated - I would like to avoid too many detours. ;-)
Thanks
Kai
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden