Re: EuGTK:Column Widths in GtkTreeView

new topic     » goto parent     » topic index » view thread      » older message » newer message
irv said...

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! smile

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!

irv said...

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!

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu