Hi there, I am a student and have just started to learn the basic syntax of python.I am making a project. It is a kids "app", it will have a main menu and then 3 button to alphabets, colors and number. in alphabets it will display alphabets from A-Z, then take a test in the form of MCQs whether a lower case letter matches the upper case one. Similarly for numbers, and colors. I have to do the project using tkinter and GUI. I am facing the problem of compiling my code of different frames and then shifting between them. I have searched the web and one solution that i have found is on this website which says to make classes. Now here when i make classes my images doo not appear and the geometery is all messed up unlike when the codes for different alphabet/color/number were different frames. How do i tackle this? how can i adjust using just place geometry method in classes? Also I please can someone explain the making of classes a little bit? Here is my code which i copied from this website or somewhere else idk, its repeitive and long, please suggest what am i missing? The gird and pack here were already in the code which i copied. I want to make my Tk() window of size "1000x624+0+0", how can i do that? and what if i want to add an image, say a picture of apple using PhotoImage in PageA. When i make a an image nd put it in the label, it doesnot show up. PLEASEEEEEE HELLLLLPPPP... My project deadline is VERY VERY CLOSE and i still have done absolutly nothing from apart this.
from tkinter import*
class SampleApp(Tk):
def __init__(self): Tk.__init__(self)
self.title = ("FunLearning")
# the container is where we'll stack frames # on top of each other, then the one we want visible # will be raised above the others container = Frame(self) container.pack(side="top", fill="both", expand=True) container.grid_rowconfigure(0, weight=1) container.grid_columnconfigure(0, weight=1)
# put all of the pages in the same location; # the one on the top of the stacking order # will be the one that is visible. frame.grid(row=0, column=0, sticky="nsew")