Hi, the following is the code for my a2 computing project. Essentially what I have tried to do is set up two basic structures of GUIS and then inherit them into other classes so I can add components to the basic structure. However, when I create a MainMenu object, only some of the components show up, the frame is not the right size and it is resizable when it shouldn't be. Any ideas? Thanks.
from tkinter import * #Allows GUIs to be created
from random import randint #allows random integers to be generated
class StaffSkeleton: #This class contains the basic layout for the staff parts of the application
def __init__(self):
StaffGui = Tk()
StaffGui.title('Thomas Hardye Sixth Form Application Program')
StaffGui.geometry('1024x800+200+200')
StaffGui.resizable(width = FALSE, height = FALSE)
#StaffSchoolLogo = PhotoImage(file='N:\Computing\A2 Computing\F454\part 3 Development\crest1-edited.gif')
#StaffSchoolImage = Label(self,image = StaffSchoolLogo).place(x=854,y=0)
class StudentSkeleton: #This class contains the basic layout for the student part of the application
def __init__(self):
StudentGui = Tk()
StudentGui.title('Thomas Hardye Sixth Form Application Program')
StudentGui.geometry('800x640+200+200') #sets the size of the window
StudentGui.resizable(width = FALSE, height = FALSE) #stops resizing of window
#StudentSchoolLogo = PhotoImage(file='N:\Computing\A2 Computing\F454\part 3 Development\crest1-edited.gif')#brings in file of school Logo*
#StudentSchoolImage = Label(self,image = StudentSchoolLogo).place(x=630,y=0)#places school image on screen
class MainMenu(StudentSkeleton):#inheriting the student skeleton for the main menu GUI
def __init__(self):
welcome = Label(text = 'Welcome to the Thomas Hardye Sixth Form Application Program',font=('TkDefaultFont',14)).place(x=80,y=30) #setting up welcome message to users
welcome2 = Label(text = 'Are you a student or member of staff?',font = ('TkDefaultFont',14)).place(x=200,y=80)
StudentSelect = Button(text = 'Student',height = 3, width = 15, font = ('TkDefaultFont',14)).place(x=100,y=300) #button to select student side of program
StaffSelect = Button(text = 'Staff', height = 3, width = 15, font = ('TkDefaultFont',14)).place(x=540,y=300) #button to select staff side of program
StudentExplain = Label(text = 'This lets you apply \n and use the \n course recommender.',font = ('TkDefaultFont',14)).place(x=90,y=450)
StaffExplain = Label(text = 'This lets you review applications \n and check subscriptions to courses. \n Please enter the password \n before pressing the button.',font = ('TkDefaultFont',14)).place(x=470,y=450)
PasswordBox = Entry(show = '*',width = 15,font = ('TkDefaultFont',14)).place(x=544,y=400)
test = MainMenu()