I'm trying to create a GUI with PySimpleGUI that contains many checkboxes with a scroll to the right to it that allows me to move around. I want my GUI to maintain its size by many checkboxes that have.
This is my code:
form = sg.FlexForm("Dynamic Combo")
layout = [[sg.Text('<-- Enlazar Clientes con Páginas web -->')],
[sg.Text('Dominio: ')], [sg.InputText()],
[sg.Text('URL del Cliente: (con http:// o https://)')], [sg.InputText()],
[sg.Button("SELECCIONAR TODOS")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Checkbox("something")], [sg.Checkbox("something")],
[sg.Text('')],
[sg.Submit('Ejecutar'), sg.Cancel('Salir')]
]
form = sg.Window('Enlazador de Páginas Web').Layout(layout)
How can I do it? I've heard that sg.Column allows me something similar, but I've tried to implement it and I have not achieved anything.
You are correct that you can place the layout inside of a Column Element in order to get scroll bars.
Try changing your last line of code to this. It will make your window smaller and add scrollbars. Read more on the parameters available to the Column element.
form = sg.Window('Enlazador de Páginas Web').Layout([[sg.Column(layout, size=(300,300), scrollable=True)]])
form.Read()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With