• 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: NSLayoutManager subclassing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLayoutManager subclassing


  • Subject: Re: NSLayoutManager subclassing
  • From: "I. Savant" <email@hidden>
  • Date: Thu, 19 Jan 2006 08:34:37 -0500

Rachel:

Since NSTextView's coordinate system is flipped (y's 0 position is at the top), everything flows down and the view remains aligned to the top of its enclosing scroll view (remember, NSTextView is automatically enclosed in a scroll view when created in Interface Builder).

What you *could* try (I have not tired this myself) is enclosing the text view inside another plain view without a flipped coordinate system, then put *that* in the scroll view. You'll have to make your enclosing view listen for frame changes in the NSTextView (so it can grow or shrink to fit the text view). You'll also probably have to adjust a few other things (the views' autoresizing masks for sure, perhaps some other things), but it shouldn't take too much effort to try it.

  If I'm missing anything, folks, please feel free to add to this.

--
I.S.


On Jan 18, 2006, at 8:36 PM, Rachel Blackman wrote:

I find myself with a situation where I need NSTextView to behave a bit differently than usual.

Specifically, I need it to work that the document is -- in effect, bottom-aligned ('valign=bottom' in HTML terms). So that if you have only one line, instead of a single line of text at the top, you have a single line of text at the bottom of the view. Adding lines will still appear at the bottom, scrolling up the lines before them, but the entire thing remains bottom-aligned.

I've been looking at NSLayoutManager and NSTextContainer as what I need to subclass and tweak to do this, and at first it seemed promising, but the documentation is a little unclear in places; I'm no longer actually certain I /can/ do this properly with them, as opposed to having to actually modify NSTextView itself.

Any thoughts?

--
Rachel 'Sparks' Blackman -- sysadmin, developer, mad scientist
"If it is not broken, give me five minutes to redesign it!"

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: NSLayoutManager subclassing
      • From: Rachel Blackman <email@hidden>
References: 
 >NSLayoutManager subclassing (From: Rachel Blackman <email@hidden>)

  • Prev by Date: Re: CORE DATA: derived values from several entities and managed object instances ??
  • Next by Date: Storing and Retrieving Strings
  • Previous by thread: NSLayoutManager subclassing
  • Next by thread: Re: NSLayoutManager subclassing
  • Index(es):
    • Date
    • Thread