From 1c3a385740f2c4e28072770a6356c471d47996b6 Mon Sep 17 00:00:00 2001 From: MikeTheWatchGuy Date: Sun, 28 Oct 2018 12:31:23 -0400 Subject: [PATCH] Made 2.7 compliant... can't use * evidently to add on more rows --- Demo_Desktop_Widget_CPU_Dashboard.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Demo_Desktop_Widget_CPU_Dashboard.py b/Demo_Desktop_Widget_CPU_Dashboard.py index 75c0b195..af4cb57a 100644 --- a/Demo_Desktop_Widget_CPU_Dashboard.py +++ b/Demo_Desktop_Widget_CPU_Dashboard.py @@ -59,15 +59,15 @@ def main(): sg.SetOptions(element_padding=(0,0), margins=(1,1), border_width=0) # ---------------- Create Layout ---------------- - graphs = [] + layout = [[ sg.RButton('', image_data=red_x, button_color=('black', 'black'), key='Exit', tooltip='Closes window'), + sg.Text(' CPU Core Usage')] ] + + # add on the graphs for rows in range(num_cores//NUM_COLS+1): row = [] for cols in range(min(num_cores-rows*NUM_COLS, NUM_COLS)): row.append(GraphColumn('CPU '+str(rows*NUM_COLS+cols), '_CPU_'+str(rows*NUM_COLS+cols))) - graphs.append(row) - - layout = [[ sg.RButton('', image_data=red_x, button_color=('black', 'black'), key='Exit', tooltip='Closes window'), sg.Text(' CPU Core Usage')], - *graphs,] + layout.append(row) # ---------------- Create Window ---------------- window = sg.Window('PSG System Dashboard',