ColumnView Headings - Not Required / Disable?

My requirement - I what a multi column table without any headers. I have looked at:

  • ColumnView: no option available and its parent Widget nothing obvious.
  • ColumnViewColumn: Has set_title but a null argument does not mean no header. A outline box is still shown. Also has visible but this controls the column as a whole. Parent GObject has nothing obvious.
  • SignalListitemFactory: nothing obvious.

I haven’t looked at ‘css’ yet but I anticipate it’s only possible to set everything as transparent and not possible to remove a heading totally.

Suggestions welcome.

Thanks Greg

Use gtk_widget_set_visible( gtk_widget_get_first_child( columnview ), FALSE );

Thank you 提及 for making the effort to respond.

As I expected the solution is rooted in C and may not be possible in Python. However I now need to go and experiment.

Thanks again

Greg

Thank you, your pointer to a solution proved very helpful and I learned something useful today.
My Python solution for future reference:

class Table(Gtk.ColumnView):
    def __init__(self):
        Gtk.ColumnView.__init__(self)
        
        #
        #
        #
        
        #  print("DEBUG: Can we get to GtkListItemWidget? ", self.get_first_child())
        table_header: Gtk.ListItemWidget = self.get_first_child()  # Note: Gtk.ListItemWidget is not available in Gtk.pyi
        table_header.set_visible(False)
        
        return
1 Like

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