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 7030759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:42:51+00:00 2026-05-28T00:42:51+00:00

I have implemented a view-based NSOutlineView in my project. I am using floating group

  • 0

I have implemented a view-based NSOutlineView in my project. I am using floating group rows. Now, I would like to have this NSOutlineView look basically like the Finder list-view (CMD-2) when it is in the “arranged-by” layout (e.g. “by kind”: CTRL-CMD-2). That means, the top-most group row should display the column titles and as soon as the next lower group row is starting to nudge the previous one out of the view, the column titles fade in on the second group row (I hope this makes sense).

Is there any out-of-the-box way to achieve this? So far I have successfully subclassed NSTableCellView to show the columns’ titles, however, I cannot get the fade-in to work as I cannot seem to find out the position of the group row in relation to the floating one above it.

Regards,
Michael

  • 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-28T00:42:51+00:00Added an answer on May 28, 2026 at 12:42 am

    I’ve found a possible way to achieve what I want. In my custom NSTableCellView’s drawRect: method, it’s of course possibly in a nasty way to find out the view’s position relative to the enclosing NSClipView. The relevant code:

    - (void)drawRect:(NSRect)dirtyRect {
      // _isGroupView is a member variable which has to be set previously
      // (usually in setObjectValue:) in order for us to know if we're a 
      // group row or not.
      if (_isGroupView) {
    
        // This is the nasty party:
        NSClipView *clipView = (NSClipView*)self.superview.superview.superview;
        if (![clipView isKindOfClass:[NSClipView class]]) {
          NSLog(@"Error: something is wrong with the scrollbar view hierarchy.");
          return;
        }
    
        NSRect clipRect = [clipView documentVisibleRect];
        CGFloat distanceToTop = self.superview.frame.origin.y - clipRect.origin.y;
        if (self.superview.frame.origin.y - clipRect.origin.y < self.frame.size.height) {
          // This means, that this NSTableCellView is currently pushing the
          // view above it out of the frame.
    
          CGFloat alpha = distanceToTop / self.frame.size.height;
          NSColor *blendColor = [[NSColor blackColor] blendedColorWithFraction:alpha    ofColor:[NSColor whiteColor]];
    
          // ...
          // do stuff with blendColor
          // ...
          // blendColor should now be the appropriate color for the wanted 
          // "fade in" effect.
          // 
        }
      }
    }
    

    I hope this makes sense ;-). Any tips are still appreciated!

    Cheers,
    Michael

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

Sidebar

Related Questions

Currently I have a ListView (using the Details View). I would like to implement
I have BaseView which implement UIViewController. Every view in project must implement this BaseView.
I have a View-based NSOutlineView bound to a NSTreeController. Everything seems to work correctly
I have taken a project based on the standard iPad SplitViewerController template and implemented
I have a view based table with a custom cell view. Inside this custom
I have a view in Eclipse (implemented by a class which extends org.eclipse.ui.part.ViewPart )
I have a simple form on a view page, implemented as a user control,
I have a Java project that I'm trying to implement with a model-view-controller design.
I've implemented a web based instant messaging / chat feature using http binding and
I have a custom list view implemented with Baseadapter. My dataset includes a string

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.