-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
73 lines (47 loc) · 2.36 KB
/
menu.py
File metadata and controls
73 lines (47 loc) · 2.36 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
import tkinter as tkr
import json
from tkinter import ttk
from screenColoscopia import formColoscopia
from settings import configs
from openConfig import loadpath
import os
config_file = os.path.join(os.path.dirname(__file__), 'documents/config.json')
forest_dark_file = os.path.join(os.path.dirname(__file__), 'documents/forest-dark.tcl')
forest_light_file = os.path.join(os.path.dirname(__file__), 'documents/forest-light.tcl')
db_file = os.path.join(os.path.dirname(__file__), 'documents/DB.json')
image_path = os.path.join(os.path.dirname(__file__), 'documents/images/imagen1.png')
# datas=[('documents/forest-light/*','documents/forest-light/'), ('documents/forest-dark/*','documents/forest-dark/'),('documents/*','documents/'), ('template.docx','.')],
def theme_mode (interruptor,style):
if interruptor.instate(["selected"]):
style.theme_use(forest_light_file)
else:
style.theme_use(forest_dark_file)
def menu():
root = tkr.Tk();
root.title("Clinica SSO");
theme_style = ttk.Style(root);
with open (config_file, "r") as file:
path = json.load(file);
root.tk.call("source",forest_light_file);
root.tk.call("source", forest_dark_file );
Frame = ttk.Frame(root);
theme_style.theme_use("forest-dark")
Frame.pack();
vers = ttk.Label(Frame,text="Version 1.0 Beta")
vers.grid(row=2,column=0,padx=10,pady=10)
widgetImages = tkr.Frame(Frame)
widgetImages.grid(row=0,column=0,padx=10,pady=10)
sosImage = tkr.PhotoImage(file=image_path)
imageadjust = sosImage.subsample(3,3)
lblbarberimg = tkr.Label(widgetImages,image= imageadjust)
lblbarberimg.grid(row=0,column=0,sticky="news",padx=10,pady=10)
widgetFrames = ttk.LabelFrame(Frame, text="Reportes");
widgetFrames.grid(row=1,column=0,padx=20,pady=20);
coloscopiaButton = ttk.Button(widgetFrames, text="Coloscopia", command=formColoscopia)
coloscopiaButton.grid(padx=20 ,pady=20, row=0 , column=0)
configPath = ttk.Button(widgetFrames,text="Configuraciones",command=configs)
configPath.grid(padx=20,pady=20,row=0,column=1)
mode_switch = ttk.Checkbutton(widgetFrames,text="Apariencia",style="Switch",command=lambda: theme_mode(mode_switch,theme_style))
mode_switch.grid(row=2,column=0,padx=20,pady=20,sticky="NEWS")
root.mainloop()
menu();