2018-09-27 20:24:09 +00:00
|
|
|
#!/usr/bin/env python
|
2019-10-23 20:10:03 +00:00
|
|
|
import PySimpleGUI as sg
|
2022-02-22 10:20:03 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
'''
|
|
|
|
Usage of Column Element
|
2022-02-22 10:20:03 +00:00
|
|
|
|
|
|
|
How to embed a layout in a layout
|
|
|
|
|
|
|
|
Copyright 2022 PySimpleGUI
|
2019-10-23 20:10:03 +00:00
|
|
|
'''
|
2018-08-16 18:16:06 +00:00
|
|
|
|
2019-12-24 23:52:47 +00:00
|
|
|
sg.theme('BlueMono')
|
2019-10-23 20:10:03 +00:00
|
|
|
|
2018-09-24 22:01:00 +00:00
|
|
|
# Column layout
|
2019-12-25 14:55:22 +00:00
|
|
|
col = [[sg.Text('col Row 1', text_color='white', background_color='blue')],
|
2020-05-07 10:22:59 +00:00
|
|
|
[sg.Text('col Row 2', text_color='white', background_color='blue', pad=(0,(25,0))),sg.T('Another item'), sg.T('another'), sg.Input('col input 1')],
|
2019-12-25 14:55:22 +00:00
|
|
|
[sg.Text('col Row 3', text_color='white', background_color='blue'), sg.Input('col input 2')]]
|
2018-09-24 22:01:00 +00:00
|
|
|
# Window layout
|
|
|
|
layout = [[sg.Listbox(values=('Listbox Item 1', 'Listbox Item 2', 'Listbox Item 3'),
|
|
|
|
select_mode=sg.LISTBOX_SELECT_MODE_MULTIPLE, size=(20, 3)),
|
2022-02-22 10:20:03 +00:00
|
|
|
sg.Column(col, background_color='blue')],
|
2018-09-24 22:01:00 +00:00
|
|
|
[sg.Input('Last input')],
|
|
|
|
[sg.OK()]]
|
2018-08-16 18:16:06 +00:00
|
|
|
|
2018-09-24 22:01:00 +00:00
|
|
|
# Display the window and get values
|
2022-02-22 10:20:03 +00:00
|
|
|
window = sg.Window('Column Element', layout, margins=(0,0), element_padding=(0,0))
|
2019-10-23 20:10:03 +00:00
|
|
|
event, values = window.read()
|
2018-08-16 18:16:06 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
sg.popup(event, values, line_width=200)
|
2018-08-16 18:16:06 +00:00
|
|
|
|
2019-10-23 20:10:03 +00:00
|
|
|
window.close()
|