Jul-27-2018, 12:30 AM
I am using Tkinter for the GUI and I am still quite new to programming python and using Tkinter.
I setup a window:
I setup a window:
window1 = tkinter.Tk() window1.title('Test window') w = 1420 h = 940 ws = window1.winfo_screenwidth() hs = window1.winfo_screenheight() x = (ws/2) - (w/2) y = (hs/2) - (h/2) window1.geometry('%dx%d+%d+%d' % (w, h, x, y)) x = (window1.winfo_screenwidth() - window1.winfo_reqwidth()) / 2 y = (window1.winfo_screenheight() - window1.winfo_reqheight()) / 2 window1.configure(background='Alice blue') header = Label(font=('arial',20, 'bold'), text = " Test program ", fg='Steel Blue',bd=3, bg='light steel blue', relief = RIDGE) header.place(relx=0.5, rely=0.04, anchor=CENTER) must_complete = Label(font=('arial',10, 'bold'), text = "All fields must be completed before submitting", fg='Steel Blue',bd=10, bg='alice blue').pack(side=BOTTOM)I then added labelframes:
#================================== INTRO FRAME ================================== adminlabel = LabelFrame(window1, text="Administration", width=1375, height=55, bd=3, fg='steel blue', bg='alice blue') adminlabel.place(relx=0.5, rely=0.128, anchor=CENTER) E1 = Label(adminlabel,font=('arial',10,'bold'), text='Agent: ', fg='steel blue', bg='alice blue') E1.place(relx=0.023,rely=0.390, anchor=CENTER) agent = Entry(adminlabel, font=('arial',10,'bold'), textvariable= agent, width=20, bg = 'alice blue', bd=2, fg='steel blue', insertwidth=2, justify=LEFT, relief=SUNKEN) agent.place(relx=0.095,rely=0.390, anchor=CENTER) SC1 = Label(adminlabel,font=('arial',10,'bold'), text='Scored by: ', fg='steel blue', bg='alice blue') SC1.place(relx=0.243,rely=0.390, anchor=CENTER) scored_by = Entry(adminlabel, font=('arial',10,'bold'), textvariable= scored, width=20, bg = 'alice blue', fg='steel blue', bd=2, insertwidth=2, justify=LEFT, relief=SUNKEN) scored_by.place(relx=0.326,rely=0.390, anchor=CENTER) D1 = Label(adminlabel,font=('arial',10,'bold'), text='Date: ', fg='steel blue', bg='alice blue') D1.place(relx=0.475,rely=0.390, anchor=CENTER) date = Entry(adminlabel, font=('arial',10, 'bold'), textvariable= date, width=20, bg = 'alice blue', bd=2, fg='steel blue', insertwidth=2, justify=LEFT, relief=SUNKEN) date.place(relx=0.545,rely=0.390, anchor=CENTER) agent.focus( #================================== INTRO FRAME ================================== intro = LabelFrame(window1, text="Introduction", width=1375, height=100, bd=3, fg='steel blue', bg='alice blue') intro.place(relx=0.5, rely=0.22, anchor=CENTER) Q1 = Label(intro,font=('arial',10,'bold'), text='Question 1 goes here', fg='steel blue', bg='alice blue') Q1.place(relx=0.145,rely=0.15, anchor=CENTER) Q2 = Label(intro,font=('arial',10,'bold'), text='Question 2 goes here', fg='steel blue', bg='alice blue') Q2.place(relx=0.14,rely=0.45, anchor=CENTER) Q3 = Label(intro,font=('arial',10,'bold'), text='Question 3 goes here', fg='steel blue', bg='alice blue') Q3.place(relx=0.126,rely=0.75, anchor=CENTER) Q1E = Entry(intro, font=('arial',10), textvariable= Q1E, width=5, bg = 'alice blue', bd=2, insertwidth=2, justify=CENTER, relief=SUNKEN) Q2E = Entry(intro, font=('arial',10), textvariable= Q2E, width=5, bg = 'alice blue', bd=2, insertwidth=2, justify=CENTER, relief=SUNKEN) Q3E = Entry(intro, font=('arial',10), textvariable= Q3E, width=5, bg = 'alice blue', bd=2, insertwidth=2, justify=CENTER, relief=SUNKEN) Q1E.place(x=800,y=12, anchor=CENTER) Q2E.place(x=800,y=36, anchor=CENTER) Q3E.place(x=800,y=60, anchor=CENTER) Q1CB = Button(intro, font=('arial',12,'bold'), text='Button 1', width=10, height=1, bg='aliceblue', fg='steel blue')#, command = comment) Q1CB.place(x=875,y=20) Q1RB = Button(intro, font=('arial',12,'bold'), text='Button 2', width=10, height=1, bg='aliceblue', fg='steel blue')#, command = comment) Q1RB.place(x=1040,y=20) Q1RPB = Button(intro, font=('arial',12,'bold'), text='Button 3', width=10, height=1, bg='aliceblue', fg='steel blue')#, command = comment) Q1RPB.place(x=1205,y=20)There are a number of additional labelframes such as the one above also added so a scroll would be needed to allow then to be seen when the program is run.
"Often stumped... But never defeated."