Re: NSTextView with irregular shape
Re: NSTextView with irregular shape
- Subject: Re: NSTextView with irregular shape
- From: Vyacheslav Karamov <email@hidden>
- Date: Thu, 14 Feb 2013 22:00:36 +0200
I know how to implement custom text layout. Good example of this I have
found in "Cocoa Programming Developer's Handbook" by David Chisnall.
This book gives an example how to implement custo text layout, but I
don't understand how to implement custom shape of NSTextView. Because my
widget grow in height while user is typing, custom image should also
grow and vertical scrollbar appears if needed.
Anyway, thank you for the quick response!
Good luck,
Vyacheslav.
14.02.2013 18:56, Keary Suska пишет:
On Feb 14, 2013, at 4:11 AM, Vyacheslav Karamov wrote:
I need to implement NSTextView descendant similar to one used in Mac iMessages App.
I have implemented live resizing, but how to set resizable image as its custom shape?
AFAIK, custom text box geometry is really a function of NSTextContainer. I am pretty sure there are examples of this somewhere, but I don't expect it to be trivial. I have been neck-deep in the Cocoa text system and the documentation is somewhat less than desirable and requires having as full an understanding as possible of multiple documents that are not well cross-referenced. A good place to start is here: http://developer.apple.com/library/Mac/#documentation/Cocoa/Conceptual/TextStorageLayer/Concepts/LayoutGeometry.html
Chances are, the work will be similar for most simple shapes, so googling for drawing text in a circle, for instance, might show enough sample code that you can figure out what is happening.
Good luck,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
_______________________________________________
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