• 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
Problems adding horiz scrollbar to NSTextView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problems adding horiz scrollbar to NSTextView


  • Subject: Problems adding horiz scrollbar to NSTextView
  • From: "Bell, Carl" <email@hidden>
  • Date: Mon, 22 Oct 2001 11:55:16 -0500
  • Thread-topic: Problems adding horiz scrollbar to NSTextView

Howdy,

I am trying to add a horizontal scrollbar to a NSTextView and am having
problems. (Why doesn't IB support this? Or does it and I'm just missing
something?) My NSTextView (and its NSScrollView) is inside a
NSSplitView.
In awakeFromNib, I add the horizontal scrollbar with the following code:

[personInfoScroller setHasHorizontalScroller:YES];
[personInfoField setHorizontallyResizable:YES];
[[personInfoField textContainer] setWidthTracksTextView:YES];
{
NSSize size = [[personInfoField textContainer] containerSize];
size.width = 10000000;
[[personInfoField textContainer] setContainerSize:size];
}

The textview is initially empty. Later, when I add text to the textview
with setString:blah, the horizontal scroll bar is updated but
incorrectly
and scrolling all the way to the right doesn't scroll to the end of the
text. But if I resize the window so that the width is wider than the
text
and then resize it back, the scrollbar is correct from then on.

What am I missing?

-cb

________________________________________________________________________
Carl W. Bell <http://www.baylor.edu/~Carl_Bell/index.html>
Sr. Analyst/Programmer Baylor University Academic Technology Center


  • Prev by Date: Platform Object Model [was: Re: CORBA with Mac OS X]
  • Next by Date: Re: Syntax coloring a NSTextView
  • Previous by thread: RE: what's not to like??
  • Next by thread: Preferred vector art file format?
  • Index(es):
    • Date
    • Thread