From 265270154040da14302e5feb196095a214062df8 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Fri, 16 Oct 2020 14:28:31 -0400 Subject: [PATCH] Window title change, sorted the entries before displaying --- DemoPrograms/Demo_User_Settings_Remember_ComboBox.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/DemoPrograms/Demo_User_Settings_Remember_ComboBox.py b/DemoPrograms/Demo_User_Settings_Remember_ComboBox.py index eaad3942..69b4c59b 100644 --- a/DemoPrograms/Demo_User_Settings_Remember_ComboBox.py +++ b/DemoPrograms/Demo_User_Settings_Remember_ComboBox.py @@ -10,14 +10,13 @@ import PySimpleGUI as sg Copyright 2020 PySimpleGUI.org """ - def main(): layout = [[sg.T('This is your layout')], - [sg.T('Enter or choose name'), sg.Combo(sg.user_settings_get_entry('names', []), size=(20,1), k='-COMBO-')], + [sg.T('Enter or choose name'), sg.Combo(sorted(sg.user_settings_get_entry('names', [])), size=(20,1), k='-COMBO-')], [sg.OK(), sg.Button('Exit')]] - event, values = sg.Window('Pattern for theme saving', layout).read(close=True) + event, values = sg.Window('Pattern for saving with Combobox', layout).read(close=True) if event == 'OK': sg.user_settings_set_entry('names', list(set(sg.user_settings_get_entry('names', []) + [values['-COMBO-'],])))