[pygtk] TreeView column/row spacing
Jeppe Ledet-Pedersen
jledet at space.aau.dk
Sat Apr 17 17:49:13 WST 2010
Hi
I am creating a small Wireshark-like sniffing program, but I am having
trouble modifying the appearance of the TreeView that lists the
received packets.
Currently, my TreeView looks like this:
http://kom.aau.dk/~jledet/treeview_column1.png
I would like to eliminate the space between columns and add a small
spacing between the rows as in Wireshark:
http://kom.aau.dk/~jledet/treeview_column2.png
I have been looking at the horizontal/vertical-separator style
properties for the TreeView widget, but without success. Is this the
right approach?
This is the code I use to create the Widget:
liststore = gtk.ListStore(str, str, str, str, str, str, str)
treeview = gtk.TreeView(liststore)
renderertext = gtk.CellRendererText()
column = gtk.TreeViewColumn("Number", renderertext, text=0,
foreground=5, background=6)
column.set_sort_column_id(0)
self.treeview.append_column(column)
...
I hope you can give me some ideas. Thank you in advance.
Regards,
Jeppe
More information about the pygtk
mailing list