GTK+ 3: Restore TreeViewColumn widths without making them behave as if manually sized

StackOverflow https://stackoverflow.com/questions/23161575

  •  05-07-2023
  •  | 
  •  

Frage

I have a TreeView whose columns are all expandable with fixed-mode sizing. I would like to restore the widths of the columns when the user restarts the app. It seems that calling set_fixed_size is the way to do this, but:

  • If I set only the widths of the columns that the user resized, then the actual column widths end up different from what they were before.
  • If instead I set all column widths explicitly, then all columns behave as though they had been resized by the user, which is not ideal.

Is there a way to restore the column widths that gets around these problems?

War es hilfreich?

Lösung

It turns out that expand interferes with fixed_width. In my case, the solution was to set fixed_width and expand=false on columns that the user resized, and expand=true on the others.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top