• 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
NSScrollView's non-scrollbar section
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSScrollView's non-scrollbar section


  • Subject: NSScrollView's non-scrollbar section
  • From: Sam Goldman <email@hidden>
  • Date: Fri, 09 Nov 2001 20:07:43 -0800

I recently posted this on OmniGroups's cocoa list, but didn't get the answer
I was looking for. Now, I did study the documentation (including superviews)
and source code, and have come to a conclusion. I think that I need to
manually make an NSRect, but I may have missed something.

I am putting a NSTextView into a NSScrollView and have gotten it to work --
sort of.

What happens is that when I type into the NSTextView and reach the scroll
bar of the NSScrollView, it keeps on typing in that line for a while and
then goes down a line. I figure the problem is that the scroll bar and/or
some tiny frame around the perimeter of the NSScrollView is making
[myScrollView bounds] larger than it should be.

I have tried every imaginable combination of method that returns a NSRect
and it still doesn't work.

Another added problem is that the NSScrollView has to resize to a
NSTabViewItem's view. That makes things more difficult.

Here's the code that I am using right now to position the views:

NSScrollView *myScrollView = [[NSScrollView alloc] initWithFrame:[[[tabView
tabViewItemAtIndex:0] view] bounds]];
NSTextView *myTextView = [[NSTextView alloc] initWithFrame:[myScrollView
bounds]];

[myScrollView setHasVerticalScroller:YES];
[myTextView setAutoresizingMask:18];
[myScrollView setAutoresizingMask:18];

[[tabView tabViewItemAtIndex:0] setView:myScrollView];
[myScrollView setDocumentView:myTextView];

Does this make sense to anyone. While positioning in IB would be better and
easier, it is not an option.

Thanks,
Sam


  • Follow-Ups:
    • Re: NSScrollView's non-scrollbar section
      • From: Jim Correia <email@hidden>
  • Prev by Date: Re: All these newbie questions that are answered by documentation
  • Next by Date: Re: NSScrollView's non-scrollbar section
  • Previous by thread: Re: Find dialog
  • Next by thread: Re: NSScrollView's non-scrollbar section
  • Index(es):
    • Date
    • Thread