[Enhancement] Focus first button in popup() calls

Offen
#6,652 9 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Feature
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
python

Rechercherichtung

Beginne damit, die popup()-Hilfsfunktionen zu finden, insbesondere popup_ok(), sowie die im Issue erwähnte tkinter-Implementierung. Verfolge, wie Popup-Schaltflächen erstellt und fokussiert werden, und überprüfe anschließend, dass eine Option focus_first_button bei den relevanten Popup-Aufrufen die erste Schaltfläche fokussiert, ohne das Standardverhalten zu ändern.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Port - TK

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

Enhancement


Environment

Operating System

Windows version ('10', '10.0.19045', 'SP0', 'Multiprocessor Free')

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.11.6 (tags/v3.11.6:8b6ee5b, Oct 2 2023, 14:57:12) [MSC v.1935 64 bit (AMD64)]

PySimpleGUI Version (sg.__version__)

4.61.0.198

GUI Version (tkinter (sg.tclversion_detailed), PySide2, WxPython, Remi)

8.6.12


Your Experience In Months or Years (optional)

2 Years Python programming experience
10 Years Programming experience overall
Yes Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)


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
  • Upgraded to the latest official release of PySimpleGUI on PyPI
  • Tried using the PySimpleGUI.py file on GitHub. Your problem may have already been fixed but not released

Detailed Description

When using the popup() calls, it would be really nice if there was a way to focus the first button by default.
I encountered this when checking for some input and creating popups if they were malformed. It's really annoying always having to touch the moouse or try tabbing through the popup if it only contains text and one button.

Something like the following would be enough:

sg.popup_ok('text', title='title', focus_first_button=True)
Vorherrschende Sprache
Python
Sterne
13.8k
Forks
1.8k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus PySimpleGUI/PySimpleGUI

Alle Issues in PySimpleGUI/PySimpleGUI

Ähnliche Issues

Weitere Issues zu Python

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.