• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTextAttachment dynamic resize?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >NSTextAttachment dynamic resize? (From: Rachel Blackman <email@hidden>)

  • Prev by Date: Re: orderOut: doesn't work as expected when executed in Spaces-mode
  • Next by Date: Crash Log with no Relation to where it Crashed
  • Previous by thread: NSTextAttachment dynamic resize?
  • Next by thread: Re: NSTextAttachment dynamic resize?
  • Index(es):
    • Date
    • Thread