Strange table view need... howto sensibly?
Strange table view need... howto sensibly?
- Subject: Strange table view need... howto sensibly?
- From: Ondra Cada <email@hidden>
- Date: Tue, 30 Jul 2002 19:36:19 +0200
Hello all,
in one application I've bumped into a strange need. There is a table
(plain ole NSTableView), which shows items from some list. The thing is,
each of the items might have more A.K.A. names, and thus might be shown in
the table on more lines -- like this:
data:
item1 ("a", "c")
item2 ("b")
table:
"a", item1 entrails
"b", item2 entrails
"c", item1 entrails
So far, it is trivial; now comes the somewhat tricky part: the customer
wants that if, when rows are re-ordered, two or more rows with the same
item happens to be consecutive, only the first should contain the actual
data (other should contain just "ditto"). Like this:
"a", item1 entrails
"c", "ditto"
"b", item2 entrails
Well, it is quite easy to check in the data source for the contents of
row-1, but here comes the really tricky part: of course, in case such a
"repeating" line happens to be the topmost one in scrolled table view, it
should be presented normally:
["a", item1 entrails ... invisible, scrolled out of the top]
"c", item1 entrails
"b", item2 entrails
Now, here I don't know howto! Perhaps frameOfCellAtColumn:row: might be
useable to check whether a row is visible, and perhaps I might use
tableView:willDisplayCell:forTableColumn:row: to determine whether the
table is scrolling (for when scrolling ends, I'd have to invalidate the
table, so as the possible "ditto" value which might happened to be
scrolled into the topmost line from below is redrawn)... but it looks like
an *extraordinarily* clumsy way...
Has anyone a better idea howto? Thanks,
---
Ondra Hada
OCSoftware: email@hidden
http://www.ocs.cz
private email@hidden
http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.