RE: NSScrollView problems when scaling an NSTextView
RE: NSScrollView problems when scaling an NSTextView
- Subject: RE: NSScrollView problems when scaling an NSTextView
- From: email@hidden
- Date: Mon, 7 Nov 2005 14:02:08 -0600
> Date: Mon, 7 Nov 2005 11:13:30 -0800 (PST)
> From: Keith Blount <email@hidden>
> Subject: RE: NSScrollView problems when scaling an NSTextView
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset=iso-8859-1
>
> This works great. The problem arises when I flip to a
> full screen mode. I do this by moving the whole text
> view to different window - removing it from its
> current
> scroll view and placing it in a different scroll view
> (I swap scroll views because I use a centering clip
> view and custom scroller; however, I have tried
> swapping to a normal scroll view in case this was the
> problem, but it made no difference). I then call the
> above code again, as full screen mode can have a
> different scale percent. At this point, there can be
> loads of extra space beneath the text in the text
> view, or there may be no scroller when there should be
> one (because there is text to scroll). It seems that
> the clip view or scroll view just isn't recognising
> the correct size (height) of the text view.
>
> Does anybody have any idea what I might be missing
> here?
Instead of moving the text view from one scroll view to another, you
could have a completely separate text view on your full screen window
and only move the NSTextStorage from one text view to another. Or have
both text views share the same text storage.
Look at figure 4 on this page:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/index.html#//apple_ref/doc/uid/10000086i
To replace a text storage use:
[[textView layoutManager] replaceTextStorage:textStorage];
Hope this helps,
Peter
_______________________________________________
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