I can't say that I have dealt with the exact situation you write of, however,
my best idea/hint is to point you to the NSTextContainer class. The NSTextView
is composed of a lot of complicated machinery and I believe you might have to
dive below the topmost layer (i.e. NSTextView itself) in order to achieve your
desired results. Your documentView (the textView) will continue to size its
width according to the contentView, but the internal "view container" for the
rich-text object being displayed inside of the textView will need to be told
not to maintain this same, width-sync'd relationship.
(I repeat, this is only a somewhat educated stab-in-the-dark, i.e. I have used
NSTextContainer's setWidthTracksTextView method. More informed people should
still be encouraged to reply.)
Good luck.
Mark Sanvitale
On Feb 4, 2010, at 1:45 PM, Knut Lorenzen wrote:
>
> Dear List,
>
> an NSScrollView ("Show Horizontal Scroller" in IB checked) contains an
> NSTextView that displays some RTFD-data, including some pictures. However,
> the Horizontal Scroller is not shown. BTW, TextEdit seems to behave exactly
> the same.
>
> Logging [[myScrollView documentView] frame].size.width shows that it has the
> same value than [[myScrollView contentView] frame].size.width. Please note
> the difference: documentView vs. contentView. That is, it looks like the
> documentView does not notice the presence of pictures wider than the
> contentView?!
>
> I've tried setting the documentView's frame width to the width of the largest
> picture. That sort of works, but as soon as the window (or the view) is
> resized, everything snaps back to the undesired state.
>
> Looking forward to ideas/hints/clues/advice.
>
> Cheers,
>
> Knut
>
>
>
>
>
> _______________________________________________
>
> Cocoa-dev mailing list ([email protected])
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/msanvitale%40real.com
>
> This email sent to [email protected]
_______________________________________________
Cocoa-dev mailing list ([email protected])
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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]