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

Re: Problems adding horiz scrollbar to NSTextView


  • Subject: Re: Problems adding horiz scrollbar to NSTextView
  • From: Philippe Devallois <email@hidden>
  • Date: Thu, 28 Feb 2002 14:27:44 +0100

In your awakeFromNib, don't forget to set the maxSize of your NSTextView.

([personInfoField setMaxSize:size];)

Indeed, NSTextView maxSize has been set to its frame size before you fixed
your textContainer size.

Hope this helps
--
phildev

> 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
> _______________________________________________
> cocoa-dev mailing list
> email@hidden
> http://www.lists.apple.com/mailman/listinfo/cocoa-dev
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: NSThread implementation
  • Next by Date: How can I hide an NSView properly?
  • Previous by thread: Sorry
  • Next by thread: Re: Problems adding horiz scrollbar to NSTextView
  • Index(es):
    • Date
    • Thread