PySimpleGUI / PySimpleGUI/PySimpleGUI
[Bug] Cut-off table columns with auto_size_columns=True
未关闭
还没有人认领这个 Issue。
enhancement
Platform Specific Issue - Mac
- 主要语言
- Python
- 星标
- 13.8k
- 派生
- 1.8k
- PR 合并指标
- 30 天内没有已合并 PR
描述
Bug
OS: macOS 10.14.6
Python version: Python 3.8.5
PySimpleGUI Port and Version:
4.28.0 Released 3-Aug-2020
<module 'PySimpleGUI' from '/Users/jo/.virtualenvs/letsplaytdd-4tKX_lhX/lib/python3.8/site-packages/PySimpleGUI/__init__.py'>
Your Experience Levels In Months or Years
10 Python programming experience
10 Programming experience overall
no Have used another Python GUI Framework (tkinter, Qt, etc) previously (yes/no is fine)?
You have completed these steps:
- Read instructions on how to file an Issue
- Searched through main docs http://www.PySimpleGUI.org for your problem
- Searched through the readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
- Looked for Demo Programs that are similar to your goal http://www.PySimpleGUI.com
- Note that there are also Demo Programs under each port on GitHub
- Run your program outside of your debugger (from a command line)
- Searched through Issues (open and closed) to see if already reported
- Try again by upgrading your PySimpleGUI.py file to use the current one on GitHub. Your problem may have already been fixed but is not yet on PyPI.
Description of Problem / Question / Details
It seems the column heading is used to calculate the column width. If there are values in rows which are longer than the heading, this cuts off the columns.
Code To Duplicate
import PySimpleGUI as sg
print(sg)
print(sg.version)
## Paste your code here
layout = [
[sg.Text('Personal finances')],
[sg.Table(
headings=['One', 'Two'],
values=[[20000, 2000]],
auto_size_columns=True
)],
[sg.OK(), sg.Cancel()]
]
window = sg.Window(
title="Personal finances",
layout=layout,
margins=(5, 5),
size=(900, 600),
font=('San Francisco', 15)
)
while True:
event, values = window.read()
print(event)
if event == sg.WINDOW_CLOSED or event == 'Cancel':
break
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
使用提供的、设置了 auto_size_columns=True 的 sg.Table 示例重现该问题,重点关注表格如何相对于行值调整标题的大小。未指定源文件或测试;当显示的列能够容纳比其标题更长的值,且不破坏现有表格行为时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- desktop, frontend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100