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

  • Home
  • SEARCH
  • 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 4574632
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T19:57:00+00:00 2026-05-21T19:57:00+00:00

This site really is awesome. I have what is hopefully a simple question this

  • 0

This site really is awesome.

I have what is hopefully a simple question this time. I would like to pass any scrolling input from the user (could be wheel, touchpad, etc) to an NSScrollView which contains my own subviews.

At the moment if the user scrolls just on the documentView (outside of my subviews’ frames) the scroll works normally but if they scroll while the cursor is over a subview nothing happens. So basically I’d like to have the subview recognise the scroll event and pass it back to the scroll view.

Any help is greatly appreciated.

Cheers.

EDIT:
Here is the code I’m using to add the subviews to the documentView
_milestoneView and _activityView are both NSView subclasses which have a corresponding nib (created with instantiateNibWithOwner and objects hooked up accordingly) they contain a NSTextField, PXListView and some have a NSProgressIndicator.

-(void)useProject:(NSNumber *)projectId
{
[self resetView];

NSRect bounds = [[self view] bounds];
NSRect defaultFrame = NSMakeRect(20, NSMaxY(bounds)-93, NSMaxX(bounds)-20, 50);


//Prepare the milestone view
if (_milestoneView == nil)
    _milestoneView = [MilestoneView milestoneViewFromNibWithFrame:defaultFrame withProject:[BCLocalFetch projectForId:projectId]];
[_milestoneView reloadList];


//Prepare the activity view
if (_activityView == nil)
    _activityView = [ActivityView activityViewFromNibWithFrame:defaultFrame withProject:[BCLocalFetch projectForId:projectId]];

[self refresh];
}

I then use the refresh method to reposition them as the content sizes vary so I wanted to have a separate method.

-(void)refresh
{
//Position the milestones first
[_milestoneView setFrameOrigin:NSMakePoint(20, NSMaxY([[self view] bounds])-[_milestoneView frame].size.height-60)];
if ([[_milestoneView milestones] count] > 0)
    [[self view] addSubview:_milestoneView];

//Now the activity view
[_activityView setFrameOrigin:NSMakePoint(20, [_milestoneView frame].origin.y-[_activityView frame].size.height-20)];
[[self view] addSubview:_activityView];

[self autosizeView];
}

-(void)autosizeView
{
//Resize the view to accommodate all subviews
NSRect oldFrame = [[self view] frame];
CGFloat lastY = [_activityView frame].origin.y;
if (lastY < 0) {
    CGFloat newHeight = oldFrame.size.height + (-lastY);
    [[self view] setFrameSize:NSMakeSize(oldFrame.size.width, newHeight)];
}
[[NSNotificationCenter defaultCenter] postNotificationName:@"BBContentDidResizeNotification" object:self];
}
  • 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-21T19:57:01+00:00Added an answer on May 21, 2026 at 7:57 pm

    Ok so I came back to the issue and finally got it worked out. The implementation was actually quite simple.
    I added a property to PXListView to point to the NSScrollView that is to be scrolled.
    I then implemented NSResponder’s scrollWheel: method like this:

    -(void)scrollWheel:(NSEvent *)theEvent
    {
        //Pass scrolling to the superview
        [_scrollHandler scrollWheel:theEvent];
    }
    

    And all is well!

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

Sidebar

Related Questions

it's my first question in this awesome site. I've really searched a lot and
I would really like to stop the menu items jumping around on this site
I've downloaded the Really Simple Color Picker in jQuery from this site I've followed
This is my first time using this site so sorry for any bad formatting
this is the first question I post in this site, so you have to
I stumbled upon this site http://nathanborror.com/ and really loved the way they have done
I have this site: http://www.problemio.com and if you go there and click any link
I have found this web site really helpful since everybody helps here with the
I really like the transition and effects used on this site: http://imagemechanics.com.au/ . I
this site is like an ecommerce site and i have two tables that i'm

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.