Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- class PokemonDecklistCreatorApp(tk.Tk):
- def __init__(self, *args, **kwargs):
- tk.Tk.__init__(self, *args, **kwargs)
- container = tk.Frame(self)
- container.pack(side="top", fill="both", expand=True)
- container.grid_rowconfigure(0, weight=1)
- container.grid_columnconfigure(0, weight=1)
- self.frames = {}
- for F in (MainMenu, DecksMenu, SearchMenu, ExtrasMenu):
- frame = F(parent=container, controller=self)
- self.frames[F] = frame
- frame.grid(row=0, column=0, sticky="nsew")
- self.show_frame(MainMenu)
- def show_frame(self, page_name):
- frame = self.frames[page_name]
- frame.tkraise()
- def quitProg(self):
- app.destroy()
- class MainMenu(tk.Frame):
- def __init__(self, parent, controller):
- tk.Frame.__init__(self, parent)
- self.controller = controller
- self.btnDecksMenu = tk.Button(self,text = "Decks Menu", command = lambda: controller.show_frame(DecksMenu)), width = 300, height = 150)
- self.btnDecksMenu.place(x = 200, y = 385)
- self.btnSearchMenu = tk.Button(self, text = "Search Menu", command = self.searching), width = 300, height = 150)
- self.btnSearchMenu.place(x = 550, y = 385)
- self.btnExtrasMenu = tk.Button(self, text = "Extras Menu", command = lambda: controller.show_frame(ExtrasMenu)), width = 300, height = 150)
- self.btnExtrasMenu.place(x = 900, y = 385)
- self.btnQuitProg = tk.Button(self, text = "Quit Program", command = controller.quitProg), width = 75, height = 25)
- self.btnQuitProg.place(x = 1200, y = 700)
- def searching(self):
- #CardViewerSearchResults.setDeck("None")
- lambda: controller.show_frame(SearchMenu)
- class DecksMenu(tk.Frame):
- def __init__(self, parent, controller):
- tk.Frame.__init__(self, parent)
- self.controller = controller
- class SearchMenu(tk.Frame):
- def __init__(self, parent, controller):
- tk.Frame.__init__(self, parent)
- self.controller = controller
- class ExtrasMenu(tk.Frame):
- def __init__(self, parent, controller):
- tk.Frame.__init__(self, parent)
- self.controller = controller
- app = PokemonDecklistCreatorApp()
- app.geometry("1400x788")
- app.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement