Comments (4)
Type of Issue : Question
Operating System
PySimpleGUI Port : tkinter
Versions
Version information can be obtained by calling
sg.main_get_debug_data()
Or you can print each version shown in ()Python version : 3.4.4 (v3.4.4:737efcadf5a6, Dec 20 2015, 19:28:18) [MSC v.1600 32 bit (Intel)]
PySimpleGUI Version : 4.60.5
GUI Version : 8.6.1
Detailed Description
How do I redraw the entire window layout in PySimpleGUI? I tried calling self.window.layout(layout), but it didn't work.
from pysimplegui.
More detailed information: Missing Troubleshooting Section
Better not to remove any section of the issue form, like this
Troubleshooting
These items may solve your problem. Please check those you've done by changing - [ ] to - [X]
- Searched main docs for your problem PySimpleGUI Documenation
- Looked for Demo Programs that are similar to your goal. It is recommend you use the Demo Browser! Demo Programs
- None of your GUI code was generated by an AI algorithm like GPT
- 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.com
- Have upgraded to the latest release of PySimpleGUI on PyPI (lastest official version)
- Tried running the Development Build. Your problem may have already been fixed but not released. Check Home Window for release notes and upgrading capability
- For licensing questions please email [email protected]
from pysimplegui.
layout(rows)
Second of two preferred ways of telling a Window what its layout is. The other way is to pass the layout as
a parameter to Window object. The parameter method is the currently preferred method. This call to Layout
has been removed from examples contained in documents and in the Demo Programs. Trying to remove this call
from history and replace with sending as a parameter to Window.
To update your GUI immediately, call window.refresh()
, or the GUI will be updated only until you call window.raad()
.
To renew your window, you may do it like following example, new elements in the layout will all be reinitialized, not reuse the layout.
import PySimpleGUI as sg
def new_window(width=45):
layout = [[sg.Input(size=width, key='-IN-'), sg.Button("OK")]]
return sg.Window("Title", layout, finalize=True)
window = new_window()
while True:
event, values = window.read()
if event == sg.WIN_CLOSED:
break
elif event == "OK":
try:
n = int(values['-IN-'])
except:
n = -1
if 0 < n < 80:
win = new_window(n)
window.close()
window = win
window.close()
from pysimplegui.
If you want to retain the values already entered into the window, then you can use the new setting
parameter was added to elements in the PySimpleGUI 5 release.
You will need to upgrade your environment, which I recommend regardless as you're running a very old version of Python (3.4) and an extremely old version of tkinter (8.6.1). You should be getting a warning message about your tkinter version being too old.
The parameter is shown in the documentation, primarily here:
https://docs.pysimplegui.com/en/latest/documentation/module/user_settings/#settings-defined-in-layouts
I added a Demo Program that shows how to use this parameter as well and included an example of "restarting" / redrawing a window should you need a feature like this for you application.
from pysimplegui.
Related Issues (20)
- [Question] How to trap an event HOT 2
- [Enhancement] CI friendly handling for the first time installation dialog HOT 3
- [Question] How to update class parameter within inherited class HOT 4
- [Question] How To Re-Enter Data For A Specific Field - AND 'CR to act like TAB HOT 1
- [ Bug] sg.ColorChooserButton Unless Additional Tkinter Import HOT 1
- [Bug] Hitting the image-count limit [Fail to create pixmap with Tk_GetPixmap in TkImgPhotoInstanceSetSize] HOT 6
- [Question] Import error HOT 3
- [Question] Change focus highlight when tabbing to button HOT 8
- [ Enhancement/Bug/Question] NOTE - you can also call sg.main() or sg.main_open_github_issue() to post an issue HOT 1
- [ Question] Compiling Errors since License validation HOT 2
- [ Bug] Broken Doc Link HOT 2
- [Question] NOTE - Table get doesn't work HOT 6
- [ Enhancement] allow arrowheads for lines in tkinter graphs HOT 8
- [Question] Question of shortcut HOT 17
- [Question] How to Use PySimpleGui Programs on Other PCs HOT 1
- [ Question] How to detect when we manually enter a value in combo box in Pysimple GUI HOT 1
- [Bug] Table colored rows flashes when updating in 5.0, while they didn't in 4.x HOT 10
- [Question] No right_click_menu in Combo HOT 3
- [Enhancement] Reusing Context Menu HOT 6
- [ Bug] Garbled output on WSL HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysimplegui.