diff --git a/main.py b/main.py index 49ad54c..e16db0f 100644 --- a/main.py +++ b/main.py @@ -11,7 +11,10 @@ WINDOW=None colum_lut = ["Serial Number","Brand","Grade","Name"] layout = [[sg.Menu([['File', ['Open', 'Save', 'Add Computer','Remove Computer']]])], [sg.Text("search"), sg.Input(s=(35,))], - [sg.Input(s=(19,)),sg.Input(s=(6,)),sg.Input(s=(6,)),sg.Input(s=(4,))], + [sg.Input(s=(19,),enable_events=True,key="filter Serial Number"), + sg.Input(s=(6,),enable_events=True,key="filter Brand"), + sg.Input(s=(6,),enable_events=True,key="filter Grade"), + sg.Input(s=(4,),enable_events=True,key="filter Name")], [sg.Table([["word","Yes"]],colum_lut,key = "table", enable_events=True)], [sg.Text("Serial Number")], [sg.Input(key='Serial Number')], @@ -97,6 +100,10 @@ def main(): print(f'Click on column {column}') # Sort data on the table by the value of column # then update window['-TABLE-'].update(values=new_data) + else: + print(event, values[event]) + Computers=Query() + print(db.search(Computers[event[7:]].find(values[event])!=-1)) # Finish up by removing from the screen