# Watkins Quality Ford GUI Demo from Tkinter import * from tkMessageBox import * AMversion = '0.9' def notdone(): showerror('You will love this feature, but ...', '... it does not yet exist.') def aboutme(): showinfo('About AutoMagic!', 'AutoMagic! Version %s\n25 July 2001\n\n' 'A GUI demo\n' 'written in Python/Tk.' % AMversion) def makemenu(win): top = Menu(win) win.config(menu=top) project = Menu(top, tearoff=0) project.add_command(label='New Project', command=notdone, underline=0) project.add_command(label='New Project Quick-Start', command=notdone, underline=0) project.add_command(label='Open Project', command=notdone, underline=0) project.add_command(label='Save Project', command=notdone, underline=0) project.add_command(label='Quit', command=win.quit, underline=0) top.add_cascade(label='Project', menu=project, underline=0) reports = Menu(top, tearoff=0) reports.add_command(label='New Report', command=notdone, underline=0) reports.add_command(label='New Report Quick-Start', command=notdone, underline=0) reports.add_command(label='Open Report', command=notdone, underline=0) reports.add_command(label='Print Report', command=notdone, underline=0) top.add_cascade(label='Reports', menu=reports, underline=0) controlpanel = Menu(top, tearoff=0) controlpanel.add_command(label='Reminders', command=notdone, underline=0) controlpanel.add_command(label='Look and Feel', command=notdone, underline=0) controlpanel.add_command(label='Add-Ons', command=notdone, underline=0) controlpanel.add_command(label='Preferences', command=notdone, underline=0) controlpanel.add_command(label='Options', command=notdone, underline=0) top.add_cascade(label='Control Panel', menu=controlpanel, underline=0) security = Menu(controlpanel, tearoff=0) security.add_command(label='Manager Login', command=notdone, underline=0) security.add_command(label='Users and Passwords', command=notdone, underline=0) security.add_command(label='Encryption', command=notdone, underline=0) security.add_command(label='Schedule Back-Ups', command=notdone, underline=0) security.add_command(label='Network and Internet', command=notdone, underline=0) controlpanel.add_cascade(label='Security', menu=security, underline=0) customer = Menu(top, tearoff=0) customer.add_command(label='New Customer', command=notdone, underline=0) customer.add_command(label='Update Customer', command=notdone, underline=0) top.add_cascade(label='Customer', menu=customer, underline=0) impexp = Menu(customer, tearoff=0) impexp.add_command(label='Import Customer', command=notdone, underline=0) impexp.add_command(label='Import Customer List', command=notdone, underline=0) impexp.add_command(label='Export Customer', command=notdone, underline=0) impexp.add_command(label='Export Customer List', command=notdone, underline=0) customer.add_cascade(label='Import/Export', menu=impexp, underline=0) help = Menu(top, tearoff=0) help.add_command(label='Help Topics', command=notdone, underline=0) help.add_command(label='Tutorial', command=notdone, underline=0) help.add_command(label='Frequently Asked Questions', command=notdone, underline=0) help.add_command(label='AutoMagic Assistant', command=notdone, underline=0) help.add_command(label='About', command=aboutme, underline=0) top.add_cascade(label='Help', menu=help, underline=0) if __name__ == '__main__': root = Tk() root.title('AutoMagic!') makemenu(root) msg = Label(root, text='Customers kick ass!') msg.pack(expand=YES, fill=BOTH) msg.config(relief=SUNKEN, width=110, height=30, bg='beige') root.mainloop()