|
From: | Friedrich Beckmann |
Subject: | Re: Sheet replacement discussions |
Date: | Thu, 7 Jan 2016 22:48:56 +0100 |
Hi John, thanks for summarizing our discussion. It was really nice! Some thoughts to your summary below...
I remember that we both came to the same conclusion that the column width should be derived from the rendering result of the column header width as default width plus manual changes via mouse. Those manual adjustments should be possible per column. The row height should be derived fix for all rows from the rendering result of the row header height. We do not assume that the cell rendering should have an influence on the column width and row height. Displacement from adjustment, column/row number from adjustment and column width must of course be 100% aligned between the header axis and body. So we both think that this should be computed once. You compute this in the axes and the body asks for the results. Then you align the axes and the body widgets via GtkGrid such that the rendering is also visually aligned. I have not done the headers yet and my first idea was to render them in the GtkLayout right away. So in my view the difference is more related to the question if the rendering happens in several widgets which are strongly coupled or in one widget. You mentioned it yesterday that reducing the size of a widget below its „minimal“ size is not easy. I looked a little bit into this yesterday and I didn’t find a simple method either. So it seems that this requires some clipping window? Therefore I thought it might be a way to render the headers also via cell_renderer where the clipping is already included. I had a glance at the GtkTreeView way and I think they use GdkWindows to clip the buttons.
I think this is a misunderstanding. Assume you want to access row 5, column 15. See the code below summarized from GtkTreeIter iter; guint row = 5; guint col = 15; /* This translates an integer row number into an iter */ gtk_tree_model_iter_nth_child (tree_view->model, &iter, NULL, row); /* This does the data access to row 5 column 15 */ gtk_tree_model_get_value (tree_view->model, &iter, col, &val); This is a random access giving the value for row 5 and column 15 from the model, no? Maybe you assume that gtk_tree_model_iter_nth_child will traverse the model, but that is not the case. See:
between column headers and the data in the column. If there is that strong linkage, then it might be safer to have the strict relation also in the data model. For example it should not be possible by design to have a different number of columns when you ask the body data model and the column header model. If a variable is removed, then the data and the header is removed because the belong together, right? Maybe it is easier to think of different interfaces to one data model. Then the data model would have a GtkTreeModel interface for the body data and a ColumnHeader Interface for the column header data. Cheers! Fritz |
signature.asc
Description: Message signed with OpenPGP using GPGMail
[Prev in Thread] | Current Thread | [Next in Thread] |