This repository was archived by the owner on Jun 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstack.kv
More file actions
105 lines (89 loc) · 2.48 KB
/
stack.kv
File metadata and controls
105 lines (89 loc) · 2.48 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#: import ToggleButton kivy.uix.togglebutton.ToggleButton
<StackElementWidget>:
val: val
address: address
orientation: 'vertical'
canvas.before:
Color:
rgb: 0.3, 0.4, 0.6
Rectangle:
size: self.width*8/10, self.height*.1
pos: self.x+self.width/10, self.y + self.height*.4
BoxLayout:
size_hint_y: .4
Label:
size_hint_y: .1
id: address
color: 0,0,0,1
Label:
size_hint_y: .1
id: val
BoxLayout:
size_hint_y: .4
<StackCreationWidget>:
stack_size: _stack_size
BoxLayout:
size_hint_x: .5
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'data type'
TextInput:
id: data_type
font_size: self.height/2
multiline: False
write_tab: False
BoxLayout:
size_hint_x: .5
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'size'
TextInput:
id: _stack_size
font_size: self.height/2
multiline: False
write_tab: False
on_text_validate:
self.parent.parent.create_stack(_stack_size.text, data_type.text)
Button:
text: 'enter'
on_press:
self.parent.parent.create_stack(_stack_size.text, data_type.text)
<StackInsertionWidget>:
BoxLayout:
size_hint_x: .3
BoxLayout:
size_hint_x: .4
Label:
canvas.before:
Color:
rgb: 0.4, 0.5, .3
Rectangle:
pos: self.pos
size: self.size
text: 'data'
TextInput:
id: insdata
font_size: self.height/2
multiline: False
write_tab: False
on_text_validate: self.parent.parent.push(insdata.text)
Button:
text: 'push'
on_press: self.parent.parent.push(insdata.text)
BoxLayout:
size_hint_x: .3
<StackDeletionWidget>:
BoxLayout:
Button:
text: 'pop'
on_press: self.parent.parent.pop()