I've looked in the gtk source code and the header height is private. I've tried something but it didn't work as wanted (the heightWithHeader is 1?!)
Glib::RefPtr<Gdk::Window> pWindow = treeView.get_bin_window();
treeView.set_headers_visible(true);
pWindow->get_size(width, heightWithHeader);
treeView.set_headers_visible(false);
pWindow->get_size(width, heightWithoutHeader);
r_treeView.set_headers_visible(true);
returnValue = heightWithHeader - heightWithoutHeader;
Can you help me with another solution or a fix to my code?
Update: I have to adjust the height of the treeview to display a fixed number of rows. I do this by adjusting the size of the container (a scrolledwindow) to headerHeight + numberRowsToDisplay * heightOfRow.