PySimpleGUI / PySimpleGUI/PySimpleGUI

[Enhancement] PySimpleGUIQt Browse-type buttons would benefit from having the `size_px` parameter

Open
#5,771 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement Port - Qt
Dominant language
Python
Stars
13.8k
Forks
1.8k
PR merge metrics
No merged PRs in 30d

Description

Type of Issue (Enhancement, Error, Bug, Question)

The FileBrowse object has no size_px parameter

Operating System

Windows 10 Enterprise version 10.0.19044

PySimpleGUI Port (tkinter, Qt, Wx, Web)

PysimpleGUIQt (Qt Port)


Versions

Python version

Python 3.10.6

PySimpleGUI Version

PySimpleGUIQt v0.35.0


Your Experience In Months or Years (optional)

4 Years Python programming experience

5 Years Programming experience overall

Have used another Python GUI Framework? No

Troubleshooting

These items may solve your problem. Please check those you've done by changing - [ ] to - [X]

  • Searched main docs for your problem www.PySimpleGUI.org
  • Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demos.PySimpleGUI.org
  • If not tkinter - looked for Demo Programs for specific port
  • For non tkinter - Looked at readme for your specific port if not PySimpleGUI (Qt, WX, Remi)
  • Run your program outside of your debugger (from a command line)
  • Searched through Issues (open and closed) to see if already reported Issues.PySimpleGUI.org
  • Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description

I am currently writing a program for which I for once must make it look somewhat Professional.
To achieve this, wanted to have uniform Buttons.
I used the "size_px" argument to set the size of my buttons to a fix and reproducible value.
The FileBrowse Object however does not support "size_px", only "size".

Code To Duplicate

A short program that isolates and demonstrates the problem (Do not paste your massive program, but instead 10-20 lines that clearly show the problem)

This pre-formatted code block is all set for you to paste in your bit of code:

import PySimpleGUIQt as sg

#layout = [[sg.Button("Button", size_px=(100, 100))]]
layout = [[sg.FileBrowse("Browse Devices", file_types=(("Device Configs", "*txt"),), key="BROWSEDEVICEBUTTON", pad=(0, 15), size_px=(100, 100))]]
window = sg.Window("title", layout)

while True:
    event, value = window.read()
    if event == sg.WIN_CLOSED: break

if you comment out the layout with the FileBrowse and instead use the normal Button, you can compare the two with each other.

Watcha Makin?

Im a Student working in a company between semesters and have been tasked with creating a program to write certain Tables to the EEPROM of the devices we are selling. Since this is my first program to be used via a GUI, i chose PySimpleGUI as it is easy to start with.

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

Start at the PySimpleGUIQt FileBrowse implementation and compare how the regular Button handles the size_px parameter. Verify the supplied FileBrowse example, and consider the work complete when size_px is accepted and produces the requested fixed button dimensions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
desktop
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.