From 1dbc22c41e0685ef8f57ad7bb4005fc04381e049 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 18 Feb 2022 13:59:10 -0500 Subject: [PATCH] Removed the "Edit Me (This Program)" button since it caused confusion. Right click to choose "Edit me". Advanced mode is not on by default. Added PySimpleGUI version checking to warn about edit features --- ...rowser_START_HERE_Demo_Programs_Browser.py | 41 ++++++++++--------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/DemoPrograms/Browser_START_HERE_Demo_Programs_Browser.py b/DemoPrograms/Browser_START_HERE_Demo_Programs_Browser.py index 131ad0fe..067ed006 100644 --- a/DemoPrograms/Browser_START_HERE_Demo_Programs_Browser.py +++ b/DemoPrograms/Browser_START_HERE_Demo_Programs_Browser.py @@ -145,7 +145,7 @@ def advanced_mode(): :return: True if user indicated wants the advanced GUI to be shown (set in the settings window) :rtype: bool """ - return sg.user_settings_get_entry('-advanced mode-', False) + return sg.user_settings_get_entry('-advanced mode-', True) @@ -467,14 +467,14 @@ def make_window(): right_col = [ [sg.Multiline(size=(70, 21), write_only=True, key=ML_KEY, reroute_stdout=True, echo_stdout_stderr=True, reroute_cprint=True)], - [sg.Button('Edit Me (this program)'), sg.B('Settings'), sg.Button('Exit')], + [sg.B('Settings'), sg.Button('Exit')], [sg.T('PySimpleGUI ver ' + sg.version.split(' ')[0] + ' tkinter ver ' + sg.tclversion_detailed, font='Default 8', pad=(0,0))], [sg.T('Python ver ' + sys.version, font='Default 8', pad=(0,0))], [sg.T('Interpreter ' + sg.execute_py_get_interpreter(), font='Default 8', pad=(0,0))], ] - options_at_bottom = sg.pin(sg.Column([[sg.CB('Verbose', enable_events=True, k='-VERBOSE-'), - sg.CB('Show only first match in file', default=True, enable_events=True, k='-FIRST MATCH ONLY-'), + options_at_bottom = sg.pin(sg.Column([[sg.CB('Verbose', enable_events=True, k='-VERBOSE-', tooltip='Enable to see the matches in the right hand column'), + sg.CB('Show only first match in file', default=True, enable_events=True, k='-FIRST MATCH ONLY-', tooltip='Disable to see ALL matches found in files'), sg.CB('Find ignore case', default=True, enable_events=True, k='-IGNORE CASE-'), sg.CB('Wait for Runs to Complete', default=False, enable_events=True, k='-WAIT-') ]], @@ -491,7 +491,7 @@ def make_window(): [options_at_bottom]] # --------------------------------- Create Window --------------------------------- - window = sg.Window('PSG Demo & Project Browser', layout, finalize=True, icon=icon, resizable=True, use_default_focus=False) + window = sg.Window('PSG Demo & Project Browser', layout, finalize=True, icon=icon, resizable=True, use_default_focus=False, right_click_menu=sg.MENU_RIGHT_CLICK_EDITME_VER_EXIT) window.set_min_size(window.size) window['-DEMO LIST-'].expand(True, True, True) @@ -518,7 +518,21 @@ def main(): The main program that contains the event loop. It will call the make_window function to create the window. """ + try: + version = sg.version + version_parts = version.split('.') + major_version, minor_version = int(version_parts[0]), int(version_parts[1]) + if major_version < 4 or minor_version < 32: + sg.popup('Warning - Your PySimpleGUI version is less then 4.35.0', + 'As a result, you will not be able to use the EDIT features of this program', + 'Please upgrade to at least 4.35.0', + f'You are currently running version:', + sg.version, + background_color='red', text_color='white') + except Exception as e: + print(f'** Warning Exception parsing version: {version} ** ', f'{e}') + sg.set_options(icon=icon) find_in_file.file_list_dict = None old_typed_value = None @@ -697,7 +711,8 @@ def main(): if line is not None: sg.cprint(f'Added to Clipboard Full Path {full_filename}', c='white on purple') sg.clipboard_set(full_filename) - + elif event == 'Version': + sg.popup_scrolled(sg.get_versions(), keep_on_top=True, non_blocking=True) window.close() @@ -708,18 +723,4 @@ if __name__ == '__main__': icon = b'iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAsSAAALEgHS3X78AAAK/2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4NCjx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIF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06HVDPgAA57W6v2aXAgrKCBrazKyGzrVDBSfmHSn/vWXU6si2xf6GMWCN9yM/u5VwjZeXYdSg9559+JDt5LWzlvw5fi5OQFoChS+qtAK88GLv/rzs4+zASBVpkd2w+s7OASPjgEfQztoVCdH5k+WZo3q994e5WV8zivXdMI3xFsYX2H2YAC4C7ZXbGl/SvqsWhrodVr+vLgAeXryxt4vviuDkZVi2FMsz3julutWyuV31IJgKr0gHxbJYyyDfRkH+ik6AcWX04uDt9wDVfdoiP1SRvlRwmwjQNM2UVlamfZKXd7T3t4B+SvxltvWMRS8YmDkn616vBvj0NFB66ng2i5/w3b+OylIqtdi0Go0wMUbSOjQ4KGB6CossNTSpPrBgzKhCaqmhibaCJokiigw2FxbZimszAUIIutTq8D3xW36wmE0OFmVC7WICpqs0SQmnSOf5hFpCGMpWTAd7hGV9ePgdiVSmyNu7r8zPx3egU7XQwCOl51J/URJItr5xVZxYcgCgbH9q25MBQgiM4+NcmUjUrair23FJFtt81hnkrDPIZhZIf37eUXvx7H4TcrjcCZ6nx0hsfHx9nEzWsJEGImiAC8B1leP8f/Ym/JvEctwm5a/JFMyQzsc0T4EBwIuK/pGbkVVuN5i9KSOE4C2ZVMFYLPRI4ZHiHjbIfTbILhbISOGRYnuxqOV8zaL9/TR+gYF98w96Qs3DQ3wA0HO4xmalctOq4JAee7Co53/D/z2BPwAlMRlLdQS6SQAAAABJRU5ErkJggg==' -if __name__ == '__main__': - try: - version = sg.version - version_parts = version.split('.') - major_version, minor_version = int(version_parts[0]), int(version_parts[1]) - if major_version < 4 or minor_version < 32: - sg.popup('Warning - Your PySimpleGUI version is less then 4.35.0', - 'As a result, you will not be able to use the EDIT features of this program', - 'Please upgrade to at least 4.35.0', - f'You are currently running version:', - sg.version, - background_color='red', text_color='white') - except Exception as e: - print(f'** Warning Exception parsing version: {version} ** ', f'{e}') main()