Synchronized NSTableViews
Synchronized NSTableViews
- Subject: Synchronized NSTableViews
- From: David <email@hidden>
- Date: Sat, 20 Jan 2007 09:32:35 -0600
There are plenty of references to synchronizing NSScrollViews and
their contents but I am attempting to synchronize NSTableViews.
There are obviously issues with row and column selection when either
may span more than one table. You also have to worry about resizing
of columns and drag and drop.
The reasoning for doing this is explained with the following
diagram. I have 6 NSTableViews butted up against each other and
arranged like so:
123
456
Tables 2 and 5 synchronize with a horizontal scrollbar attached to
the bottom of 5. Tables 4, 5, and 6 synchronize with a vertical
scrollbar attached to the right side of 6. 1 and 3 do not scroll.
This arrangement is used so you can have lots of data columns in
table 5 associated with each record in table 4 with a summary of
those data columns listed in 6. Table 2 is used to allow rows of
header data for each data column of 5.
Synchronizing the scrolling of this is easy. The problem is when you
select a record in 4 for instance you need to have it appear as
though that selection spans tables 4, 5, and 6. Columns in table 2
and 3 must also span across each other. I am able to make it appear
the selection spans across these tables by subclassing NSTableView
and overriding highlightSelectionInClipRect and using my own datacell
which overrides highlightColorWithFrame.
I have not started resizing of columns or drag and drop but was
curious if anyone has attempted something similar or if someone can
suggest any other approach that may be simpler and more robust.
Thanks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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