New imports... switched order so that PyCharm will pick up with Python 3 import first
This commit is contained in:
parent
aeafdfeb19
commit
4548b1dd9b
84 changed files with 1071 additions and 265 deletions
|
@ -7,19 +7,20 @@ sg.SetOptions(font= ('Calibri', 12, 'bold'))
|
|||
|
||||
layout = [
|
||||
[sg.Text('Spinner and Combo box demo', font = ('Calibri', 14, 'bold'))],
|
||||
[sg.Spin([sz for sz in range (-9,10)], initial_value = 0),
|
||||
sg.Spin([sz for sz in range (-9,10)], initial_value = 0),
|
||||
sg.Text('Pick operation', size = (13,1)),
|
||||
[sg.Spin([sz for sz in range (-9,10)], size = (2,1),initial_value = 0),
|
||||
sg.Spin([sz for sz in range (-9,10)], size = (2,1), initial_value = 0),
|
||||
sg.Text('Pick operation ->', size = (15,1)),
|
||||
sg.InputCombo(['Add','Subtract','Multiply','Divide'], size = (8,6))],
|
||||
[sg.Text('Result: ')],[sg.InputText(size = (6,1), key = 'result'),
|
||||
[sg.Text('Result: ')],[sg.InputText(size = (5,1), key = 'result'),
|
||||
sg.ReadButton('Calculate', button_color = ('White', 'Red'))]]
|
||||
|
||||
window = sg.Window('Enter & Display Data', grab_anywhere=False).Layout(layout)
|
||||
window = sg.Window('Enter & Display Data', grab_anywhere= False).Layout(layout)
|
||||
|
||||
while True:
|
||||
button, value = window.Read()
|
||||
|
||||
if button is not None:
|
||||
#convert returned values to integers
|
||||
val = [int(value[0]), int(value[1])]
|
||||
if value[2] == 'Add':
|
||||
result = val[0] + val[1]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue