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

[Question] Refreshing of Frame contents possible? #1505

Closed
eyeonus opened this issue May 31, 2019 · 6 comments
Closed

[Question] Refreshing of Frame contents possible? #1505

eyeonus opened this issue May 31, 2019 · 6 comments

Comments

@eyeonus
Copy link

eyeonus commented May 31, 2019

I have a window with a frame in it that I want to be able to change the contents of based on the value of a variable.

So if that value is "market", the frame will show things related to "market",

if that value is "nav", the frame will show things related to "nav".

I can not seem to get the contents of the frame to change from the initial value.

Is it not possible, or am I just not doing it right?

@chris-vecchio
Copy link

You may want to try rewriting your issue using the official issue template.

@eyeonus
Copy link
Author

eyeonus commented May 31, 2019

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

Operating System
All

Python version
All

PySimpleGUI Port and Version
PySimpleGUI <= 3.36.0+

Code or partial code causing the problem
Is there any method to alter the contents of a Frame's layout?

@MikeTheWatchGuy
Copy link
Collaborator

Having trouble understanding the question.

If you want to "refresh" your window so that the consents are updated, then you can call Window.Refresh() which will refresh all of the Elements, Frames included.

Is this what you meant?

@MikeTheWatchGuy
Copy link
Collaborator

Or, do you want to change the buttons, input, text fields inside your frame to listboxes, sliders? Something more along those lines?

If so, I'm sorry to say no, but there are several ways around using tabs. Or pre-made but hidden elements.

@eyeonus
Copy link
Author

eyeonus commented May 31, 2019

The latter. The content of the layout itself being changed, not necessarily the values of the fields within that content.

@MikeTheWatchGuy
Copy link
Collaborator

Yea, that's just not how PySimpleGUI was designed.

It's on the list, but it's gonna be quite some time before dynamic layouts are going to get worked on.

The way I get past these things and others have as well is to build a new window entirely and switch it with the one you've been using.

If you search through the issues for dynamic layout or something along those lines, you'll see a number of requests along with suggestions on how to get around it sometimes.

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

3 participants