-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhomeView.py
More file actions
55 lines (48 loc) · 1.59 KB
/
homeView.py
File metadata and controls
55 lines (48 loc) · 1.59 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
# Minhas Kamal (minhaskamal024@gmail.com)
# 13 Mar 24
import tkinter as tk
class HomeView:
create_new_movement_option = "Create new movement"
create_new_patient_option = "Create new patient"
perform_movement_option = "Perform movement"
@classmethod
def show(cls, view_frame: tk.Frame, operation_option: tk.StringVar) -> None:
view_frame.name = cls.__name__
tk.Label(
view_frame,
text="Select operation").pack(
padx=10,
pady=(10, 40))
tk.Radiobutton(
view_frame,
text=cls.create_new_movement_option,
value=cls.create_new_movement_option,
variable=operation_option).pack(
padx=10,
pady=(5, 5))
tk.Radiobutton(
view_frame,
text=cls.create_new_patient_option,
value=cls.create_new_patient_option,
variable=operation_option).pack(
padx=10,
pady=(5, 5))
tk.Radiobutton(
view_frame,
text=cls.perform_movement_option,
value=cls.perform_movement_option,
variable=operation_option).pack(
padx=10,
pady=(5, 50))
return
# test
if __name__ == "__main__":
ui = tk.Tk()
ui.option_add("*Font", ('Arial', 12))
ui.option_add("*Background", "#fff")
view_frame = tk.Frame(ui)
view_frame.pack(fill="both")
operation_option = tk.StringVar(view_frame, "0")
HomeView.show(view_frame, operation_option)
ui.mainloop()
print(operation_option.get())