PySimpleGUI / PySimpleGUI/PySimpleGUI
Documentation: Slider() size parameter sizes height in pixels, not in rows
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 13.8k
- Fork
- 1.8k
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Type of Issue (Enhancement, Error, Bug, Question)
Bug
Operating System
Ubuntu 21.04
PySimpleGUI Port (tkinter, Qt, Wx, Web)
tkinter
Versions
Version information can be obtained by calling sg.main_get_debug_data()
Or you can print each version shown in ()
Python version (sg.sys.version)
3.8.5 (default, Jan 27 2021, 15:41:15)
PySimpleGUI Version (sg.__version__)
4.40.0
GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)
tkinter
Your Experience In Months or Years (optional)
Years Python programming experience
~2
Years Programming experience overall
20+
Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
yes
Anything else you think would be helpful?
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 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
- Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released
Detailed Description
When passing the size=() parameter to sg.Slider. the height is supposed to be specified in rows. However, it appears to be in pixels.
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 PySimpleGUI as sg
layout=[
[sg.Slider(key='slider1', orientation='h')], # default works fine
[sg.Slider(key='slider2', orientation='h', size=(30,1))], # height should be 1 row, but sizes in pixels
[sg.Slider(key='slider3', orientation='h', size=(30,5))], # height should be 5 row, but sizes in pixels
[sg.Slider(key='slider4', orientation='h', size=(30,18))] # 18 pixels looks more normal
]
win=sg.Window('Slider bug demo', layout, finalize=True)
while True:
event, values = win.read()
if event == sg.WIN_CLOSED or event == 'Exit':
break
Screenshot, Sketch, or Drawing
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Parti dal punto di ingresso sg.Slider e riproduci nel port tkinter il layout segnalato con le quattro dimensioni dello slider indicate nel corpo dell’issue. Conferma che l’altezza della dimensione viene interpretata in righe, incluso size=(30,1), e usa il comportamento dimostrato come verifica del completamento.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- desktop
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100