Merge pull request #3394 from PySimpleGUI/Dev-latest

Dark Grey 9 theme, slight change to error display when trying to kill…
This commit is contained in:
PySimpleGUI 2020-09-18 13:04:22 -04:00 committed by GitHub
commit de62db17ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View File

@ -7,6 +7,8 @@ import operator
CONFIRM_KILLS = False
"""
Utility to show running processes, CPU usage and provides way to kill processes.
Based on psutil package that is easily installed using pip
@ -46,10 +48,10 @@ def show_list_by_name(window):
def main():
# ---------------- Create Form ----------------
# sg.theme('Topanga')
sg.theme('Dark Grey 9')
layout = [[sg.Text('Process Killer - Choose one or more processes',
size=(45,1), font=('Helvetica', 15), text_color='red')],
size=(45,1), font=('Helvetica', 15), text_color='yellow')],
[sg.Listbox(values=[' '], size=(50, 30), select_mode=sg.SELECT_MODE_EXTENDED, font=('Courier', 12), key='-processes-')],
[sg.Text('Click refresh once or twice.. once for list, second to get CPU usage')],
[sg.Text('Filter by typing name', font='ANY 14'), sg.Input(size=(15,1), font='any 14', key='-filter-')],

View File

@ -97,7 +97,7 @@ def show_list_by_cpu():
def main():
# ---------------- Create Form ----------------
# sg.theme('Topanga')
sg.theme('Dark Grey 9')
layout = [[sg.Text('Python Process Killer - Choose one or more processes',
size=(45, 1), font=('Helvetica', 15), text_color='yellow')],
@ -147,7 +147,8 @@ def main():
kill_proc(pid=pid)
# kill_proc_tree(pid=pid)
except Exception as e:
sg.popup_no_wait('Error killing process', e, auto_close_duration=2, auto_close=True, keep_on_top=True)
if event.endswith('Selected'): # only show the error if trying to kill only 1 process
sg.popup_no_wait('Error killing process', e, auto_close_duration=2, auto_close=True, keep_on_top=True)
window['-processes-'].update(show_list_by_name() if name_sorted else show_list_by_cpu())
if event.endswith('Exit'):
break