Question

I have an app made of two GtkPaned widgets, one inside the other so that the app actually displays 3 columns.

How can I set the widths of these columns as percentages? For instance so that the first column occupies 20% of the available width, the second 30% and the third 50%.

I've already tryed to put one hundred GtkButtons (for example) in a row at the bottom of the app, then I added another row containing 20 of them inside the first column and so on. Lastly I created a GtkSizeGroup between all of these buttons, but it didn't work as expected, they had different widths.

Also the "width" property can't be set using the builtin CSS theming engine.

Was it helpful?

Solution

A basic approach would be to get the outer panes allocation, and set the pixel width of the right pane of the GtkPaned widget such that you'd get your percentage.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top