Skip to content

Commit 3d95bc5

Browse files
committed
Added versioning info. Added button to global settings
1 parent 58b9f79 commit 3d95bc5

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

DemoPrograms/Demo_PyCharm_Diff_2_Files.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import PySimpleGUI as sg
2-
2+
import sys
33
"""
44
Compare 2 .py files using PyCharm's compare utility
55
If you use PyCharm, then you've likely used their awesome
@@ -10,14 +10,17 @@
1010

1111
def main():
1212

13-
layout = [[sg.T('This is your layout')],
13+
layout = [[sg.T('Choose 2 files to compare using PyCharm\'s compare utility', font='_ 18')],
1414
[sg.Text('Filename:'), sg.Combo(values=sorted(sg.user_settings_get_entry('-filenames1-', [])),
1515
default_value=sg.user_settings_get_entry('-last filename chosen1-', None),
16-
size=(40,1), auto_size_text=False, k='-COMBO1-'), sg.FileBrowse(), sg.B('Clear History', k='-CLEAR1-')],
16+
size=(90,1), auto_size_text=False, k='-COMBO1-'), sg.FileBrowse(), sg.B('Clear History', k='-CLEAR1-')],
1717
[sg.Text('Filename:'),sg.Combo(values=sorted(sg.user_settings_get_entry('-filenames2-', [])),
1818
default_value=sg.user_settings_get_entry('-last filename chosen2-', None),
19-
size=(40,1), auto_size_text=False, k='-COMBO2-'), sg.FileBrowse(), sg.B('Clear History', k='-CLEAR2-')],
20-
[sg.Button('Compare'), sg.Button('Exit')]]
19+
size=(90,1), auto_size_text=False, k='-COMBO2-'), sg.FileBrowse(), sg.B('Clear History', k='-CLEAR2-')],
20+
[sg.Button('Compare'), sg.Button('Exit'), sg.T('PySimpleGUI ver ' + sg.version.split(' ')[0] + ' tkinter ver ' + sg.tclversion_detailed + 'Python ver ' + sys.version, font='Default 8', pad=(0,0))],
21+
[sg.Text('Note - You must setup the PyCharm information using PySimpleGUI global settings')],
22+
[sg.Button('Global Settings')]
23+
]
2124

2225
window = sg.Window('Compare 2 files using PyCharm', layout)
2326
while True:
@@ -40,6 +43,8 @@ def main():
4043
sg.user_settings_set_entry('-filenames2-', [])
4144
sg.user_settings_set_entry('-last filename chosen2-', '')
4245
window['-COMBO2-'].update(values=[], value='')
46+
elif event == 'Global Settings':
47+
sg.main_global_pysimplegui_settings()
4348
window.close()
4449

4550
if __name__ == '__main__':

0 commit comments

Comments
 (0)