I tried a to loop some elements in PySimpleGUI using PySimpleGUIQt here's the code:
list_1 = ['a', 'b', 'c', 'd']
list_2 = ['e', 'f', 'g', 'h']
layout = [[Sg.Column([[Sg.Input(do_not_clear=True, size=(20, 0.7), enable_events=True, key=f'G_INPUT0{j}'), Sg.Column([[Sg.Input(do_not_clear=True, size=(14, 0.7), enable_events=True, key=f'INPUT{i}{j}') for i in range(9)]])],[Sg.Listbox(list_1, size=(20, 0.7), enable_events=True, key=f'G_LIST0{j}'), Sg.Column([[Sg.Listbox(list_1, size=(14, 0.7), enable_events=True, key=f'LIST{i}{j}')for i in range(9)]])],[Sg.Text(' G: ', size=(20, 0.7), key=f'G_TEXT{j}'), Sg.Column([[Sg.Text(f' T{i}: ', size=(14, 0.7), key=f'TEXT{i}{j}')for i in range(9)]])]])]for j in range(3)]
window = Sg.Window('Sample GUI', layout, finalize=True)
while True:
event, values = window.Read()
print(event)
print(values)
Output:
The issue is if I want to add new loop I need to add
Sg.Column
which makes extra space, and add one more loop but I don't wanna use Sg.Column
so can anyone tell me a fix where I can get get similar to this result made using ms paint