Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- LARGE_FONT= ("Verdana", 14)
- class MathsQuizapp(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 = {}
- frame = NamePage(container, self)
- self.frames[NamePage] = frame
- frame.grid(row=0, column=0, sticky="nsew")
- self.show_frame(NamePage)
- def show_frame(self, cont):
- frame = self.frames[cont]
- frame.tkraise()
- class NamePage(tk.Frame):
- def _init__(self, *args, **kwargs):
- tk.Frame.__init__(self, parent)
- label = tk.label(self, text="Please enter your name", font=LARGE_FONT)
- label.pack(pady=10, padx=10)
- app = MathsQuizapp()
- app.mainloop()
Add Comment
Please, Sign In to add comment