class NewMenu(Frame):
def __init__(self,parent=None):
Frame.__init__(self, parent)
self.pack(expand=YES, fill=BOTH)
self.createWidget()
self.master.title("Hotel Ganga Maiya-Hotel_ERP")
self.master.iconname("tkpython")
def createWidget(self):
self.makeMenuBar()
self.makeToolBar()
L = Label(self, text='Welcome Back')
L.config(relief=SUNKEN, width=100, height=20, bg='white')
L.pack(expand=YES,fill=BOTH)
def makeToolBar(self):
toolbar = Frame(self, cursor='hand2', relief=SUNKEN, bd=2)
toolbar.pack(side=BOTTOM, fill=X)
Button(toolbar, text='Quit', command=self.quit) .pack(side=RIGHT)
Button(toolbar, text='Engage Room', command=self.greeting) .pack(side=LEFT)
def makeMenuBar(self):
self.menubar = Menu(self.master)
self.master.config(menu= self.menubar)
self.bookRoomMenu()
self.viewDataMenu()
self.accountingMenu()
self.imageMenu()
self.billingMenu()
def bookRoomMenu(self):
pulldown= Menu(self.menubar)
pulldown.add_command(label='New Customer', command=self.notdone)
pulldown.add_command(label= 'Old Customer', command=self.quit)
self.menubar.add_cascade(label='Book Room', underline=0, menu=pulldown)
def viewDataMenu(self):
pulldown = Menu(self.menubar)
pulldown.add_command(label= 'Room Number Wise', command=self.notdone)
pulldown.add_command(label= 'Room Category Wise' , command=self.greeting)
# pulldown.add_separator()
# pulldown.add_command(label='Delete', command=self.greeting)
#pulldown.entryconfig(4, state=DISABLED)
self.menubar.add_cascade(label='Booking History', underline=0, menu=pulldown)
def accountingMenu(self):
pulldown= Menu(self.menubar)
pulldown.add_command(label='Account Calculater', command=self.notdone)
pulldown.add_command(label= 'Some thing', command=self.notdone)
self.menubar.add_cascade(label='Accounting', underline=0, menu=pulldown)
def imageMenu(self):
self.menubar.add_cascade(label='Guest list', underline=0, )
# photoFiles = ('nike.png','adidas.png','Avira.png')
# pulldown = Menu(self.menubar)
#self.photoObjs=[]
#for file in photoFiles:
# img = PhotoImage(file='C:/Users/CyberSurvillence/Documents/img/' + file)
# pulldown.add_command(image=img, command=self.notdone)
# self.photoObjs.append(img)
#self.menubar.add_cascade(label='Guest List', underline=0, menu=pulldown)
def billingMenu(self):
#pulldown= Menu(self.menubar)
# pulldown.add_command(label='Account Calculater', command=self.notdone)
# pulldown.add_command(label= 'Some thing', command=self.notdone)
self.menubar.add_cascade(label='Billing', underline=0, )
def greeting(self):
showinfo('greeting','Greeting')
def notdone(self):
showerror('Not implemented','Not yet available')
def quit(self):
if askyesno('Verity quit','Are you sure you want to quit?'):
Frame.quit(self)
if __name__ == '__main__': NewMenu().mainloop()
`