Merge pull request #3656 from PySimpleGUI/Dev-latest

Make gauge update immediately in 1 jump
This commit is contained in:
PySimpleGUI 2020-11-23 16:43:44 -05:00 committed by GitHub
commit 8b0c681be2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -288,8 +288,8 @@ def main(location):
if gauge.change():
new_angle = cpu_percent*180/100
window['-gauge VALUE-'].update(f'{int(cpu_percent)}%')
gauge.change(degree=new_angle, step=new_angle)
gauge.change(degree=new_angle, step=180)
gauge.change()
# ----------- update the graphics and text in the window ------------
# update the window, wait for a while, then check for exit
event, values = window.read(timeout=UPDATE_FREQUENCY_MILLISECONDS)

View File

@ -298,8 +298,8 @@ def main(location):
new_angle = ram_percent*180/100
window['-gauge VALUE-'].update(f'{ram_percent}')
window['-RAM USED-'].update(f'{human_size(ram.used)}')
gauge.change(degree=new_angle, step=new_angle)
gauge.change(degree=new_angle, step=180)
gauge.change()
# ----------- update the graphics and text in the window ------------
# update the window, wait for a while, then check for exit