Added a menubar with a setting item
This commit is contained in:
parent
1642d5d14e
commit
0c9b691780
|
@ -71,7 +71,8 @@ def create_settings_window(settings):
|
||||||
def create_main_window(settings):
|
def create_main_window(settings):
|
||||||
sg.theme(settings['theme'])
|
sg.theme(settings['theme'])
|
||||||
|
|
||||||
layout = [[sg.T('This is my main application')],
|
layout = [[sg.Menu([['&File', []], ['&Edit', ['&Settings'], ],['&Help', '&About...'],])],
|
||||||
|
[sg.T('This is my main application')],
|
||||||
[sg.T('Add your primary window stuff in here')],
|
[sg.T('Add your primary window stuff in here')],
|
||||||
[sg.B('Ok'), sg.B('Exit'), sg.B('Change Settings')]]
|
[sg.B('Ok'), sg.B('Exit'), sg.B('Change Settings')]]
|
||||||
|
|
||||||
|
@ -86,9 +87,10 @@ def main():
|
||||||
window = create_main_window(settings)
|
window = create_main_window(settings)
|
||||||
|
|
||||||
event, values = window.read()
|
event, values = window.read()
|
||||||
|
|
||||||
if event in (None, 'Exit'):
|
if event in (None, 'Exit'):
|
||||||
break
|
break
|
||||||
if event == 'Change Settings':
|
if event in ('Change Settings', 'Settings'):
|
||||||
event, values = create_settings_window(settings).read(close=True)
|
event, values = create_settings_window(settings).read(close=True)
|
||||||
if event == 'Save':
|
if event == 'Save':
|
||||||
window.close()
|
window.close()
|
||||||
|
|
Loading…
Reference in New Issue