-
Notifications
You must be signed in to change notification settings - Fork 0
/
td_gen_via_composed.py
58 lines (50 loc) · 1.86 KB
/
td_gen_via_composed.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import PySimpleGUI as sg
import time
from layout_directive_definitions import Gelem, BlockLD, BlockLI
from layout_directive_definitions import TreeNodeLD, TreeNodeLI
import random
import event_codegen as ecm
import layout_generator_step_by_step as lg
from everything_bagel_dictionary import everything_bagel
import event_codegen as ecm
bld1 = BlockLD([
Gelem("button1", "button 1", sg.Button, sty={"auto_size_button": 'False',
"size": (8, 4)
}, ex_toggle_attrs=[('button_color', (
('white', 'green'), ('blue', 'black')))]),
Gelem("button2", "button 2", sg.Button, sty={"auto_size_button": 'False',
"size": (8, 4)
})
], stacked='H', framed=True
)
bli1 = BlockLI(bld1, ['A', 'B'])
bld2 = BlockLD([
Gelem("text1", "text 1", sg.Text, sty={"auto_size_text": 'False',
"size": (8, 4)
}),
Gelem("text2", "text 2", sg.Text, sty={"auto_size_text": 'False',
"size": (8, 4)
})
], stacked='H', framed=False
)
bli2 = BlockLI(bld2, ['A', 'B'])
tnli = TreeNodeLI(bli1,
bli2, stacked='H', framed=True)
lg.set_tnli_layout(tnli)
the_layout = lg.compose_layout_li(tnli)
ecm.gen_event_actions_li(tnli)
print(the_layout)
layout = []
exit_button_row = [[
sg.Button('Exit')
]
]
layout = layout + [[the_layout]] + exit_button_row
window = sg.Window('PGAppAnalytics', layout)
while True:
event, values = window.read()
print("event pressed = ", event)
if event == 'Exit':
break
everything_bagel(window, event)
window.close()