#GUI Group: Nora, Josh, Dylan, Denny #April 17 #CSC323 #The main menu GUI for the Game of Life from tkinter import * class MainMenu: """The Main Menu GUI, which displays the Main Menu and options.""" def __init__(self, parent): parent.geometry("600x400") """Choose background colors""" self.con_myContainerLeft = Frame(parent, width=2000, bg="darkblue") self.con_myContainer1 = Frame(parent, width=2000, bg="black") self.con_myContainerRight = Frame(parent, width=2000, bg="darkblue") """Display title text.""" w = Label(root1, text="Welcome to Grinnaliens!", bg="white", fg="black") w.pack(fill=X) self.con_myContainerLeft.pack(side = TOP, fill = BOTH, expand = YES) self.con_myContainer1.pack(side = TOP, fill = NONE, expand = NO) self.con_myContainerRight.pack(side = TOP, fill = BOTH, expand = YES) ##Begin MainMenuButtons self.frm_ButtonLayout = Frame(self.con_myContainer1) self.frm_ButtonLayout.pack(side=TOP, fill=BOTH, expand=YES) self.btn_Single = Button(self.frm_ButtonLayout, text="Single-User Game", width=15, background="white") self.btn_Single.bind("", self.singleuser) self.btn_Single.pack() self.btn_Network = Button(self.frm_ButtonLayout,text="Networked Game", width=15, background="white") self.btn_Network.pack() self.btn_Options = Button(self.frm_ButtonLayout, text="Options", width=15, background="white") self.btn_Options.pack() self.btn_Credits = Button(self.frm_ButtonLayout,text="Credits",width=15, background = "white") self.btn_Credits.pack() self.btn_Quit=Button(self.frm_ButtonLayout, text="Quit", width=15, background="white") self.btn_Quit.bind("", self.exitbutton) self.btn_Quit.pack() ##End MainMenuButtons def singleuser(self, event): root1.destroy() import SingleUserScreen quit() def exitbutton(self, event): root1.destroy() quit() root1 = Tk() whatever1 = MainMenu(root1) root1.wm_title("Main Menu") root1.mainloop()