Get sibling of cell in GtkColumnView row

I have a GtkColumnView widget and, in a callback, I pass the GtkColumnViewCell as user data.
With the GTK4 inspector when I press the ‘next sibling’ button, on that GtkColumnViewCell, I move to the next cell in the row (next column, same row).
However; when I call gtk_widget_get_next_sibling with the GtkColumnWidgetCell as an argument, I get a NULL returned.

How can I get the sibling widget programatically (in C), of the GtkColumnViewCell?

You assume the cells are laid out in a grid within the same container, which is not the case: a column view is an horizontal list of columns, each with a vertical list of cells. If you try to get the sibling of a cell you get nothing, because the adjacent cell is in the next column.

What are you actually trying to achieve?

I have a GtkColumnView widget with GtkEntry widgets in the cells.
When I use the mouse to edit the entry, the row selection of the GtkColumnView ancestor does not follow, so I have to explicitly select the item from the model.
To keep the row looking like it’s selected, I set the background color of the GtkEntry widgets to be transparent (so the selected row appears blue right accross). Now though, the text is hard to read (black against blue). I can change the CSS class when the cell is selected but I also need to do this to the other cells in the row.
As you can see, I’ve tied myself up in knots :sunglasses:
If the cells are GtkLabel widgets, the text color seems to follow the row selection (becoming white when selected and black when not selected).

GtkColumnView with GtkEntry widgets in the cells
Screenshot from 2024-05-07 13-44-41

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.