-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstudentdb.kv
51 lines (44 loc) · 1.22 KB
/
studentdb.kv
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
# Reference studentdb.py
#: import main studentdb
#: import ListAdapter kivy.adapters.listadapter.ListAdapter
#: import ListItemButton kivy.uix.listview.ListItemButton
StudentDB:
<StudentDB>:
orientation: "vertical"
first_name_text_input: first_name
last_name_text_input: last_name
student_list: students_list_view
padding: 10
spacing: 10
BoxLayout:
size_hint_y: None
height: "40dp"
Label:
text: "First Name"
TextInput:
id: first_name
Label:
text: "Last Name"
TextInput:
id: last_name
BoxLayout:
size_hint_y: None
height: "40dp"
Button:
text: "Submit"
size_hint_x: 15
on_press: root.submit_student()
Button:
text: "Delete"
size_hint_x: 15
on_press: root.delete_student()
Button:
text: "Replace"
size_hint_x: 15
on_press: root.replace_student()
# Define starting data and point to the ListItemButton
# in the Python code
ListView:
id: students_list_view
adapter:
ListAdapter(data=["Doug Smith"], cls=main.StudentListButton)