tags:

views:

209

answers:

2

I need to remove the sorting arrow from a column header. This can be done by calling set_sort_indicator(false) on the column.

The arrow isn't displayed, but the space for it seems to still be reserved. If the title of the column is big enough to fill all the header, the last part is clipped (where the arrow should be).

Is there a way to make the title fill the whole header?

A: 

This seems to be a bit weird in GTK+. I downloaded and read through relevant parts of the GtkTreeViewColumn's code, and it seems to use this logic:

  if (tree_column->show_sort_indicator ||
       (GTK_IS_TREE_SORTABLE (model) && tree_column->sort_column_id >= 0))
    gtk_widget_show (arrow);
  else
    gtk_widget_hide (arrow);

Where arrow is the widget holding the arrow. This seems to indicate that the arrow widget is always packed into the horizontal box that makes up the column's header, and then just hidden (not removed) if it's not supposed to be visible. That will mean it's still there in the box, occupying space and causing the label to be clipped.

I'd recommend searching through the GTK+ bugtracker for an issue about this, and if none is found, create one.

unwind
Thank you for the response. I was looking myself in the GTK code and I notice that, but I thought that if the widget is packed and then hidden, it won't occupy the space. I've done some work in QT recently and there when you hide a widget the space is not used anymore.
Hm ... Yeah, that sure sounds weird. Now I'm doubting my own answer a bit, since it seems odd that something invisible should take up space. I won't go back and read more code right now though, and I still recommend the bug tracker route.
unwind
A: 

Ok, so I've submitted a bug report to gtk. They said that it is not an issue and it won't be fixed.

I've looked on other graphical toolkits (windows, qt) and their implementation is different, but this doesn't seem to matter to the guys in the gtk team.