You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would like to link a trait listener to the TabularEditor that triggers a recompute of the column widths. I tried refresh and update, and both seemed not to recompute the column widths.
Specifically, I want to call _TableViewresizeColumnsToContents within traitsui/qt4/tabular_editor.py whenever update_editor of TabularEditor (traitsui/qt4/tabular_editor.py) is triggered using the update trait listener on traitsui’s TabularEditor .
Or there could be a new listener update_column_widths in the traitsui TabularEditor that triggers resizeColumnsToContents?
Say the format for a number is changed such that the displayed text is shorter, one may want to be able to resize the columns so that more columns can be fit in the view.
From me: This may have to be an option that one can opt-in, though, as in some context, it may be desirable to keep the column sizes static.
One thing to keep in mind is that users can manually re-size columns, and this is tracked. We will need to decide whether the right behaviour is to override or preserve these (or maybe there needs to be an option to do both)?
Activity
kitchoi commentedon Dec 9, 2020
From offline discussion, the use case can be illustrated with the NumPy_array_tabular_editor_demo.py in the examples.
Say the format for a number is changed such that the displayed text is shorter, one may want to be able to resize the columns so that more columns can be fit in the view.
From me: This may have to be an option that one can opt-in, though, as in some context, it may be desirable to keep the column sizes static.
corranwebster commentedon Dec 10, 2020
One thing to keep in mind is that users can manually re-size columns, and this is tracked. We will need to decide whether the right behaviour is to override or preserve these (or maybe there needs to be an option to do both)?