-
Notifications
You must be signed in to change notification settings - Fork 0
/
mainmenu.py
61 lines (46 loc) · 1.62 KB
/
mainmenu.py
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
#Python 2.7.0
#William Skagerstrom, Teodor Karlgren
from Tkinter import Tk, Text, TOP, BOTH, X, N, LEFT
from Tkinter import *
from ttk import Frame, Label, Entry
from ttk import *
from doctorForm import *
from nurseForm import *
from queuePicker import *
#from main import *
import psycopg2
class Menu(Frame):
def __init__(self, parent, conn):
Frame.__init__(self, parent)
self.conn = conn
self.parent = parent
self.menuForm()
def quit(self):
self.parent.destroy()
def open_Nurse(self):
self.newWindow = Toplevel(self.parent)
self.app = nurseForm(self.newWindow, self.conn)
def open_Doctor(self):
self.newWindow = Toplevel(self.parent)
self.app = doctorForm(self.newWindow)
def open_QueuePicker(self):
self.newWindow = Toplevel(self.parent)
self.app = queuePicker(self.newWindow, self.conn)
def menuForm(self):
self.parent.title("Hosiptal menu")
self.pack(fill=BOTH)
menuEntry = Entry(self)
menuQuitButton = Button(self, text ="Exit", command=self.quit)
menuQuitButton.pack(side=BOTTOM, pady = 5)
menuQueueButton = Button(self,text="Add to queue", command=self.open_Nurse)
menuQueueButton.pack(side=BOTTOM, pady = 5)
menuRemoveButton = Button(self,text="Remove from queue", command=self.open_QueuePicker)
menuRemoveButton.pack(side=BOTTOM, pady = 5)
def main():
conn = psycopg2.connect("dbname=hospital user=william")
root = Tk()
root.geometry("300x120+300+300")
app = Menu(root, conn)
root.mainloop()
if __name__ == '__main__':
main()