Sorry about the visuals. Here is the question again with better spacing of example data.
I would like to write a custom cell renderer for a treeview and would appreciate any advice you may offer. I want to be able to hide any repeats cells that follow one another, with a few extra features. If standard rendering of sample data in a treeview of fruit classifications shows: Color | Size | Variety Red | 1 | a Red | 1 | b Green | 1 | a Green | 2 | a Green | 2 | b Yellow | 1 | a then my new cell renderer would render it as: Color | Size | Variety Red | 1 | a | | b Green | 1 | a | 2 | a | | b Yellow | 1 | a But then if the user scrolls down one row it would look like: Color | Size | Variety Red | 1 | b Green | 1 | a | 2 | a | | b Yellow | 1 | a So the very top row always shows the the value in the list store. Subsequent rows hide duplicate cells that are the same as cells immediately above, unless the column to the left changes. It has the effect of de-cluttering a table full of sorted/grouped data. It is essentially what most database report writers (crystal & access) do with a "hide duplicates" option . My initial thoughts are that I would have to maintain a few extra columns based on: (1) what row is at the top of the treeview, (2) has the cell to the left of the cell being considered, changed from last row to this row, and (3) is the cell above a duplicate of the cell being considered. Ideas and considered opinions would be much appreciated. Thanks Kim Kim Adil wrote: > I would like to write a custom cell renderer for a treeview and would > appreciate any advice you may offer. I want to be able to hide any > repeats cells that follow one another, with a few extra features. If > standard rendering of sample data in a treeview of fruit classifications > shows: > > Color | Size | Variety > Red | 1 | a > Red | 1 | b > Green | 1 | a > Green | 2 | a > Green | 2 | b > Yellow | 1 | a > > > then my new cell renderer would render it as: > > Color | Size | Variety > Red | 1 | a > | | b > Green | 1 | a > | 2 | a > | | b > Yellow | 1 | a > > But then if the user scrolls down one cell it would look like: > > Color | Size | Variety > Red | 1 | b > Green | 1 | a > | 2 | a > | | b > Yellow | 1 | a > > So the very top row always shows the the value in the list store. > Subsequent rows hide duplicate cells that are the same as cells > immediately above, unless the column to the left changes. It has the > effect of de-cluttering a table full of sorted/grouped data. > > It is essentially what most database report writers (crystal & access) > do with a "hide duplicates" option > . > My initial thoughts are that I would have to maintain a few extra > columns based on: > (1) what row is at the top of the treeview, > (2) has the cell to the left of the cell being considered, changed from > last row to this row, and > (3) is the cell above a duplicate of the cell being considered. > > Ideas and considered opinions would be much appreciated. > > Thanks Kim > _______________________________________________ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list > > _______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list