enthought / enthought/traitsui
Stretchy tabular editor makes last column way too wide
- Dominant language
- Python
- Stars
- 306
- Forks
- 99
- PR merge metrics
- No merged PRs in 30d
Description
If `stretch_last_section=True` (the default) for the `TabularEditor`, the resulting table has a final column which is exceedingly wide:
### Example:
```python
from traits.api import *
from traitsui.api import *
from traitsui.tabular_adapter import TabularAdapter
class Person(HasTraits):
name = Str
age = Int
class PersonAdapter(TabularAdapter):
columns = [('Name', 'name'), ('Age', 'age')]
class People(HasTraits):
persons = List(Instance(Person))
def _persons_default(self):
return [Person(name=f'Bob-{i}', age=i) for i in range(32)]
traits_view = View(
UItem(
'persons',
editor=TabularEditor(
adapter=PersonAdapter(),
stretch_last_section=True,
),
),
width=300,
resizable=True,
)
if __name__ == '__main__':
People().configure_traits()
```
### Result with `stretch_last_section=True`

### Result with `stretch_last_section=False`

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.