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?
You may want to try rewriting your issue using the official issue template.
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?
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?
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.
The latter. The content of the layout itself being changed, not necessarily the values of the fields within that content.
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.
Most helpful comment
You may want to try rewriting your issue using the official issue template.