Re: EuGTK:Column Widths in GtkTreeView
- Posted by euphoric (admin) Aug 30, 2019
- 1111 views
There are "min width", "max width", and "fixed width" properties for the columns. The widths are in pixels, you could compute this by taking 80% of the main window width, or just choose a number that looks good.
OK, dang it. I tried "min width" as "min_width," due to the GTK docs showing that property. Should I assume all properties in EuGTK are without dashes/symbols? Where do you document the use of these properties for EuGTK? I need to read some docs!
ADDED: "min-width" works during both create() and set()
I think it will be enough to get the GtkTreeView width in order to set the initial column widths, right? We shall see!
Columns will have to be named e.g. create(GtkColumn,"name=col1,...") so that you can retrieve its renderer. Ellipsize modes are 0 = none, 1 = start, 2 = middle, 3 = end. Mode 2 works best here, I think.
set("col1->renderer","ellipsize",2) -- obtain and set column's renderer set(col1,"min width",300) -- set desired width in pixels set(col1,"resizable",TRUE) -- allow sliding the columns to reveal more of the text
If other columns contain data that doesn't fit, you may have to repeat the code above for those, too. Otherwise, they'll probably fit automatically.
OK, cool. Thank you!