##April-May 2010 ##CSC323 ##Credits for ZeroLife from tkinter import * from ButtonCreator import * from LabelCreator import * import BoardScreen import BoardSetup import ShowSpecies import LoadGame from SpeciesDatabase import * import JoinNetworkGame import Menu def run(event=None): """Creates and runs the main menu""" root = Tk() menu = CreditsFrame(root) root.mainloop() class CreditsFrame: """Create and fill the Frame that represents the credits screen""" def __init__(self, parent, width=480, height=400): self.parent = parent self.parent.geometry(str(width)+"x"+str(height)) self.frame = Frame(self.parent, width=width, height=height, bg="darkblue") self.frame.pack() title = Label(self.frame, text="ZeroLife Credits\n", fg="black") title.pack(fill=X, side=TOP) """Build an empty frame for padding.""" #self.padding = Frame(self.parent, width=width, height=10, bg="darkblue") #self.padding.pack(fill=BOTH, side=TOP, expand=YES) self.container = CreditContainer(self.parent) class CreditContainer: """Creates a frame to contain the credits and calls the credit generator""" def __init__(self, parent, width = 2000, bg = "darkblue"): width = width bg = bg self.container = Frame(parent, width=width, bg="darkblue") self.container.pack(side = TOP, fill = BOTH, expand = YES) self.parent = parent self.addNames() def addNames(self): """Add names to the container""" for a in ("This game was created by: ", "Ravi Chande", "Alex Cohn", "Nora Coon", "Dylan Gumm", "Terian Koscik", "Nathan Levin", "Jesse Queen", "Josh Raymond", "Samuel Rebelsky", "Jordan Shkolnick", "Jeffrey Thompson", "Aaron Todd", "Denny Vaccaro"): d = LabelCreator(self.container, a) mainMenuButton = ButtonCreator(self.container, "Main Menu", self.spawnMenu, packOption = TOP) quitButton = ButtonCreator(self.container, "Quit", self.destroyParent, packOption = TOP) def spawnMenu(self, event = None): """Loads the Main Menu and destroys this window""" self.parent.destroy() Menu.run(event) def destroyParent(self, event= None): """Callback method for the Quit Button to destroy the frame""" self.parent.destroy()