PDA

View Full Version : PyGTK TreeView. How to reset TreeViewColumn width?



frpaul
January 20th, 2010, 10:36 PM
Hi. I made a simple file browser. When user changes directory, programm clears TreeModel and loads new data into it. How to reset width of the 1st column according to the length of filenames in the new directory. Its important when filenames are shorter, than in the previous directory and a lot of extra space between the columns is left.

steeleyuk
January 20th, 2010, 11:38 PM
I believe you can use one of three options... gtk.TREE_VIEW_COLUMN_GROW_ONLY, gtk.TREE_VIEW_COLUMN_AUTOSIZE or gtk.TREE_VIEW_COLUMN_FIXED.


column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)

I've not tested it though so no guarantees on it being what you need.

frpaul
January 21st, 2010, 01:24 PM
I believe you can use one of three options... gtk.TREE_VIEW_COLUMN_GROW_ONLY, gtk.TREE_VIEW_COLUMN_AUTOSIZE or gtk.TREE_VIEW_COLUMN_FIXED.


column.set_sizing(gtk.TREE_VIEW_COLUMN_AUTOSIZE)I' ve not tested it though so no guarantees on it being what you need.

Thanks! I'll check it out.