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

Re: Adaptable NSTableViewHeader


  • Subject: Re: Adaptable NSTableViewHeader
  • From: Nygard Steve <email@hidden>
  • Date: Tue, 30 Oct 2007 18:25:29 -0600


On Oct 30, 2007, at 10:24 AM, Mattias Arrelid wrote:

[...]
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

The table view and the header view are each in different clip views. You scroll through the height of the NSScrollView's documentView. That's why the rows in your table view start scrolling before you want them to.


I'd subclass NSScrollView to handle an additional view, for you're statistics, which you want to appear above the header. Implement - tile to put it in the right place. You may need to override - reflectScrolledClipView:. You need to get the scroll view to use the combined height of the document view and statistics view as the height it scrolls through. When you scroll down, you need to first shrink the visible height of the stats view, and use any left-over for normal scrolling of the document view. Scrolling up is just the opposite.

Clearly it would be a lot easier if you could put the stats under the header view, either at the top or bottom of the actual table view, but I think you can get it to work the way you want.

[...]
(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).

You need to call -setNeedsDisplay: when after calling setFrame:. I'm guessing you need to do the same after calling -tile.


By the way, after looking at your code, NSDivideRect() is a handy function:

NSDivideRect([self bounds], &lowerRect, &upperRect, [self minimumHeight], NSMaxYEdge);

--
Steve

_______________________________________________

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


References: 
 >Adaptable NSTableViewHeader (From: Mattias Arrelid <email@hidden>)

  • Prev by Date: Re: [Moderator] Leopard documentation update now available online
  • Next by Date: Re: [Moderator] Leopard documentation update now available online
  • Previous by thread: Adaptable NSTableViewHeader
  • Next by thread: [Moderator] Xcode and Interface Builder discussion
  • Index(es):
    • Date
    • Thread