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

For JSON support, consider using the User Settings APIs in PySimpleGUI #2

Open
PySimpleGUI opened this issue Mar 14, 2021 · 0 comments
Assignees

Comments

@PySimpleGUI
Copy link

Have you seen the User Settings APIs that are now part of PySimpleGUI?

They were added a few releases ago and are not a very important part of the SDK.

I use them for many demos now and are also holding the "global settings" for all of PySimpleGUI.

PySimpleGUI is branching out a little by providing access to other libraries that a PySimpleGUI programmer may want to use:

  • Settings (User Settings APIs)
  • Starting other programs (Exec APIs)
  • Personalizing PySimpleGUI (global settings default theme)

You'll find the newer Demo Programs that have settings that use these new User Settings APIs. There is documentation on using them. NOTE - the Cookbook has an old manual way of creating your own settings file using JSON. The purpose of the User Settings APIs was to replace this technique (I'll replace that recipe).

Here is the primary documentation on them:
https://pysimplegui.readthedocs.io/en/latest/?#user-settings-api

In addition to settings windows, they are used for "history" of elements too.

The Demo Browser application is a newer one. Lets look at it:

image

There is a settings window that uses User Settings:

image

One of the items in this window is the path to the tree combo box:

image

It has a history of previously selected items. These items are stored in the same User Settings file as other items in this window.

The point here is that this API is good for a number of uses for programs. You don't have to have a settings window to have a need like this. Any piece of data that you want to store and retrieve later is a good candidate for User Settings.

@nycynik nycynik self-assigned this Mar 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants