-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathDemo_Columns.py
More file actions
33 lines (23 loc) · 1.05 KB
/
Demo_Columns.py
File metadata and controls
33 lines (23 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python
import PySimpleGUI as sg
'''
Usage of Column Element
How to embed a layout in a layout
Copyright 2018-2026 PySimpleGUI. All rights reserved.
'''
sg.theme('BlueMono')
# Column layout
col = [[sg.Text('col Row 1', text_color='white', background_color='blue')],
[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')],
[sg.Text('col Row 3', text_color='white', background_color='blue'), sg.Input('col input 2')]]
# 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)),
sg.Column(col, background_color='blue')],
[sg.Input('Last input')],
[sg.OK()]]
# Display the window and get values
window = sg.Window('Column Element', layout, margins=(0,0), element_padding=(0,0))
event, values = window.read()
sg.popup(event, values, line_width=200)
window.close()