Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Cleanup docs and demos to use theme APIs #4598

Open
2 of 7 tasks
PySimpleGUI opened this issue Aug 8, 2021 · 0 comments
Open
2 of 7 tasks

[Enhancement] Cleanup docs and demos to use theme APIs #4598

PySimpleGUI opened this issue Aug 8, 2021 · 0 comments
Labels
Demo Programs Problem is in the demo programs (or any other non-core code) documentation Docs need updating

Comments

@PySimpleGUI
Copy link
Owner

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

@PySimpleGUI PySimpleGUI added documentation Docs need updating Demo Programs Problem is in the demo programs (or any other non-core code) labels Aug 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Demo Programs Problem is in the demo programs (or any other non-core code) documentation Docs need updating
Projects
None yet
Development

No branches or pull requests

1 participant