• 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
Adaptable NSTableViewHeader
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Adaptable NSTableViewHeader


  • Subject: Adaptable NSTableViewHeader
  • From: Mattias Arrelid <email@hidden>
  • Date: Tue, 30 Oct 2007 17:24:42 +0100

Hi everyone,

My problem is quite hard to explain in just a few words, but I'll give it a try. Additionally, I'm attaching an URL to a video shot of the running application along with the application project (only one custom class, very few lines of code) below so you can test it yourself too:

I have subclassed the NSTableHeaderView class so that when it is displayed (e.g. its drawRect is called) it renders additional information about the table view above the ordinary table column headers. Think of it as two vertical divisions:
Upper part - Shows some statistics about the table view
Lower part - Displays the table column headers


Now, if I set my tableview's headerview to my custom subclass, and place the tableview inside a NSScrollView, my custom tableview header is displayed just fine. So far, so nice. Now let us assume that the statistics are not that important for the user, so as she begins to scroll everything that is visible in the clip view (table header view + table view) is scrolled - until the only part that's visible in the custom NSTableHeaderView class are the table column headers. At this stage, the clip view should start to scroll the rows for the table view instead, keeping the header locked in the upper part of the clip view (just as a tableview with a normal header works when one scrolls).

I havn't been able to accomplish this in an efficient manner. In the attached example (which doesn't perform too much unnecessary rendering according to Quartz Debug), it almost works - there are only two things that goes wrong; (1) the table rows begins to scroll up "under" the header view instantly - I want them to do that first when the table header view has "snapped" - and (2) the table view rows don't render correctly sometimes (see movie - a part of row 11 gets stuck at the bottom of the view in the beginning).

Any suggestion on how to accomplish this would be more than welcome.

URL to project: http://arrelid.com/dump/tableTest-project.zip
URL to video: http://arrelid.com/dump/tableTest.mov

Thanks in advance
Mattias
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Adaptable NSTableViewHeader
      • From: Nygard Steve <email@hidden>
  • Prev by Date: Re: FSCatalogInfo randomness
  • Next by Date: Re: FSCatalogInfo randomness
  • Previous by thread: [CoreData] Background Insertion (was Save in Core Data from another thread)
  • Next by thread: Re: Adaptable NSTableViewHeader
  • Index(es):
    • Date
    • Thread