PySimpleGUI / PySimpleGUI/PySimpleGUI

[Bug] Cut-off table columns with auto_size_columns=True

Open
#3,303 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Platform Specific Issue - Mac
Dominant language
Python
Stars
13.8k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

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.

Bildschirmfoto 2020-08-18 um 10 22 35
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue from the provided sg.Table example with auto_size_columns=True, focusing on how the table sizes headings versus row values. No source file or test is named; done means the displayed columns fit values longer than their headings without breaking the existing table behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.