Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6058971
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T08:39:32+00:00 2026-05-23T08:39:32+00:00

I need fixed-size NSTextViews inside a larger scrolling window. IB requires that the textviews

  • 0

I need fixed-size NSTextViews inside a larger scrolling window. IB requires that the textviews be inside their own NSScrollViews, even though their min/max sizes are fixed so that they won’t actually scroll. When trackpad gestures are made within the textview frames (regardless of whether they have focus), they are captured by the textviews’ scrollviews, so nothing happens.

How do I tell the textviews’ scrollviews to pass scroll events up to the window’s main scrollview? (Or perhaps I should be asking how I tell the window’s main scrollview to handle these events itself and not pass them on to its child scrollviews.)

The IB structure is like this:

  • window
    • window’s content view
      • big scrollview for window (desired target for scroll events)
        • box
          • swappable content view in separate xib
            • scrollview for textview
              • textview

And, yes, the window does scroll correctly when the textviews do not have focus.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T08:39:33+00:00Added an answer on May 23, 2026 at 8:39 am

    This is really embarrassing. After weeks of putting it off, I made a first attempt to get a subclassed NSScrollView to behave passively — and it turned out to be a no brainer.

    Here’s the subclass:

    h file:

    #import <Cocoa/Cocoa.h>
    
    @interface ScrollViewPassive : NSScrollView {
    
    // This property is assigned a ref to windowController’s main scrollview.
    NSScrollView *svActive; 
    
    }
    
    @property (nonatomic, retain) NSScrollView *svActive;
    
    @end
    

    m file:

    #import "ScrollViewPassive.h"
    
    @implementation ScrollViewPassive
    
    @synthesize svActive;
    
    // Pass any gesture scrolling up to the main, active scrollview.
    - (void)scrollWheel:(NSEvent *)event {
        [svActive scrollWheel:event];
    }
    
    @end
    

    There’s no need to make outlets for these passive scrollviews; I give them their refs to the main scrollview right after their xibs are assigned as content to the NSBox:

        [self.boxDisplayingTextViews setContentView:self.subviewCtllr1.view];
        // A textview's superview's superview is its scrollview:    
        ((ScrollViewPassive *)[[self.subviewCtllr1.textview1 superview] superview]).svActive = self.scrollviewMain;
    

    That’s it. Works like a charm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several projects that need to write structured Textfiles, some with fixed size
I have a need for a fixed-size (selectable at run-time when creating it, not
I need to resize a picture to a fixed size. But it has to
I need to resize images in php using GD to a fixed size but
I need to create a structure or series of strings that are fixed lenght
I have an array of GLuint with fixed size: GLuint textures[10]; Now I need
I need to display an image in a fixed size div. Under the div
I need a queue with a fixed size. When I add an element and
In this I need C++ array class template, which is fixed-size, stack-based and doesn't
I need to display user entered text into a fixed size div. What i

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.