-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlayouts.sh
More file actions
executable file
·33 lines (23 loc) · 922 Bytes
/
Copy pathlayouts.sh
File metadata and controls
executable file
·33 lines (23 loc) · 922 Bytes
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
source ../src/lib.sh
init_screen
layout.create_from_screen Layout
layout.v_split Layout vbox1 vbox2 # First vbox1 takes half of screen and vbox2 takes other half
layout.h_split vbox2 hbox1=3px hbox2 hbox3=3px # hbox1 and hbox3 takes 3px and, in center, hbox2 will fill free space of vbox1
rect.new rect
rect.new child_rect
rect.set_title rect "Im first rect"
rect.set_title child_rect "And im a child"
# We can also split non-screen layouts!
# Here we split layout inside rectangle
rect.get_layout rect layout_inside_rect
layout.v_split layout_inside_rect l1 l2
rect.draw rect vbox1 # Draw rect inside vbox1
# Layout inside rect now has size of vbox1, excluding borders
rect.draw rect hbox2 # Draw the same rect inside hbox2
# Layout inside rect now has size of hbox2, excluding borders
# Draw new rect inside half of rect layout
rect.draw child_rect l1
rect.draw child_rect l2
buffer.flush
sleep 10
exit_screen