From dac6b7304506e1c268c0c3b76500e056588bcb15 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Mon, 23 Nov 2020 16:43:26 -0500 Subject: [PATCH] Make gauge update immediately in 1 jump --- DemoPrograms/Demo_Desktop_Widget_CPU_Gauge.py | 4 ++-- DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/DemoPrograms/Demo_Desktop_Widget_CPU_Gauge.py b/DemoPrograms/Demo_Desktop_Widget_CPU_Gauge.py index 745946f4..02adf611 100644 --- a/DemoPrograms/Demo_Desktop_Widget_CPU_Gauge.py +++ b/DemoPrograms/Demo_Desktop_Widget_CPU_Gauge.py @@ -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) diff --git a/DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py b/DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py index ba4f0198..537a81a3 100644 --- a/DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py +++ b/DemoPrograms/Demo_Desktop_Widget_RAM_Gauge.py @@ -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