-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathsplit.py
More file actions
54 lines (50 loc) · 1.54 KB
/
split.py
File metadata and controls
54 lines (50 loc) · 1.54 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import pglet
from pglet import SplitStack, Stack, Text
from pglet.button import Button
def split_resize(e):
for c in e.control.controls:
print("size", c.width if e.control.horizontal else c.height)
page = pglet.page("split1")
page.title = "Split test"
page.horizontal_align = "stretch"
page.vertical_fill = True
st = SplitStack(
height="100%",
horizontal=True,
# gutter_color="#eee",
gutter_size=10,
on_resize=split_resize,
controls=[
Stack(width="200", min_width="200", height="100%", controls=[Text("Column A")]),
Stack(height="100%", controls=[Text("Column B")]),
Stack(
height="100%",
width="30%",
controls=[
SplitStack(
height="100%",
gutter_color="yellow",
gutter_hover_color="orange",
gutter_drag_color="blue",
on_resize=split_resize,
controls=[
Stack(
width="100%",
bgcolor="lightGreen",
controls=[Text("Row A")],
),
Stack(
width="100%",
height="200",
max_height="400",
bgcolor="lightGreen",
controls=[Text("Row B")],
),
],
)
],
),
],
)
page.add(st)
input()