0

There is a Treeview with several TreeViewColumns. Because the default font-size is to big for my usage, I need to set the font-size in the TreeViewColumn Header.

I tried to following:

tvc = Gtk.TreeViewColumn()
tvcl = Gtk.Label("Test")
tvc.set_widget(tvcl)

But the Header of the Column is empty then. If it's possible to change the font of the TreeViewColumn().title, this would be enaugh.

HappyHacking
  • 878
  • 1
  • 12
  • 28

1 Answers1

1

Assuming you're using python (from the code), here's an example:

from gi.repository import Gtk
from gi.repository import Pango

tvc           = Gtk.TreeViewColumn (None, renderer, col)
custom_header = Gtk.Label ('Test')
tvc.set_widget (custom_header)
tvc.get_widget ().override_font (Pango.FontDescription.from_string ('8') )
tvc.get_widget ().show_all ()
luciomrx
  • 1,165
  • 1
  • 7
  • 7
  • The first way is not working for me. The field remains empty. And for the second one I get an exception, that the widget is None. – HappyHacking Jul 14 '14 at 06:18
  • they are one single code. not alternative. so you need a set_widget first before you get get_widget, if not it will throw error. (I have practice this in my projects ) – luciomrx Jul 14 '14 at 07:55
  • 1
    I finally figured it out... window.show_all() is not showing this Label. You have to call the show() method on the Label seperately – HappyHacking Jul 14 '14 at 08:54