I have a ColumnView as the child of a ScrolledWindow.
I’d like to be able to freeze the first data row in the ColumnView (similar to Excel’s freeze panes functionality) so that only the 2nd and following rows scroll.
I suspect that this is an unreasonable thing to want Gtk to do as it would require too much knowledge of each other on the part of the two widgets. I’m definitely not asking for Gtk to support this if it doesn’t already.
I’m currently thinking of having two column views and doing some magic to keep their columns the same width unless anyone know a neat trick.
Cheers,
Pat
I ended up going with the “brute force” approach. In case it helps anyone else, here’s what I did.
To keep it language neutral:
- Created two ColumnViews - one for the “frozen” rows and one for the scrolling rows. Make sure each has the identical column specs.
- Use the ColumnViewColumn set_fixed_width to ensure the corresponding columns in each view have the same widths.
- As I want the frozen and scrolled parts to look like one view (as much as possible), I used the method documented in ColumnView Headings - Not Required / Disable? (Thanks and appreciation to the authors of that thread.)
- Put both views in a vertical orientation Box and that’s it.
Cheers,
Pat