Re: NSTextAttachment dynamic resize?
Re: NSTextAttachment dynamic resize?
- Subject: Re: NSTextAttachment dynamic resize?
- From: email@hidden (Stefan Haller)
- Date: Wed, 12 Dec 2007 17:14:45 +0100
- Organization: Ableton
Rachel Blackman <email@hidden> wrote:
> Has anyone out there tackled the annoying task of having an
> NSTextAttachment which resizes with the NSTextView containing it, who
> wishes to share their hard-earned wisdom? (Specifically, I am looking
> at the case of having an attachment which is exactly the visible width
> of the NSTextView, regardless of what size the textview may currently
> be. This must apply to only one specific type of attachment; others
> remain with their current behaviors.)
Shouldn't it be sufficiant to override -(NSSize)cellSize in your
NSTextAttachmentCell subclass and return whatever size you want it to
have? You'd have to make sure that the layout is invalidated whenever
the desired sizes of your cells change, but if you want them to be the
same width as the text view, the layout will be invalidated anyway when
the text view frame size changes.
(I'm not an expert at this stuff, so I might be missing something.)
--
Stefan Haller
Ableton
http://www.ableton.com/
_______________________________________________
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