PySimpleGUI / PySimpleGUI/PySimpleGUI

[Enhancement] Cleanup docs and demos to use theme APIs

Open
#4,598 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Demo Programs documentation
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)

Enhancement

Operating System

Other version All

PySimpleGUI Port (tkinter, Qt, Wx, Web)

tkinter


Versions

Python version (sg.sys.version)

3.4

PySimpleGUI Version (sg.__version__)

4.46.0.48

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

8.6.6


Your Experience In Months or Years (optional)

44 Years Python programming experience
3 Years Programming experience overall
No Have used another Python GUI Framework? (tkinter, Qt, etc) (yes/no is fine)
❤ PySimpleGUI users....


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

Have noticed a number of issues posted with users utilizing set_options to modify color settings. The theme APIs should be used in these situations.

The documentation and Demo Programs are likely out of date and are providing examples that have not been updated.

The evolution process for PySimpleGUI has resulted in a mixed way of accomplishing operations. The way it's supposed to work is that the current docs and demos show how things are currently accomplished.

While there is a significant effort put into making PySimpleGUI 100% backward compatible, it doesn't always work out that way, especially for features that have new APIs like themes.

Code To Duplicate
import PySimpleGUI as sg

def make_win():
    layout = [  [sg.Text('My Window')],
                [sg.Input(key='-IN-')],
                [sg.Text(size=(12,1), key='-OUT-')],
                [sg.Button('Go'), sg.Button('Exit')]  ]

    window = sg.Window('Window Title', layout)
    return window

def main():
    sg.theme('dark green 1')

    window = make_win()
    while True:             # Event Loop
        event, values = window.read()
        print(event, values)
        if event == sg.WIN_CLOSED or event == 'Exit':
            break
        if event == 'Go':
            sg.theme_input_background_color('red')
            window.close()
            window = make_win()
    window.close()

if __name__ == '__main__':
    main()
Screenshot, Sketch, or Drawing

After clicking "Go", the color of the input element's background is changed for all future windows. The window is then closed and a new one is created which will have the new background color.

pPy6ObE4TJ

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

No specific files are named; start by searching the documentation and Demo Programs for set_options color examples and compare them with the theme APIs described in the issue. Update the outdated documentation and demos to use theme APIs, then verify the examples still demonstrate the intended color change behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.