I cannot seem to get my tkinter program to work properly. I have tried many different solutions, but still cannot get it to work.
Here’s my code:
root = Tk()
root.title('GUI')
text = r"""
_____ _ _ _
| ___(_)_ __ (_)___| |__ ___ _ __
| |_ | | '_ | / __| '_ / _ '__|
| _| | | | | | __ | | | __/ |
|_| |_|_| |_|_|___/_| |_|___|_|
=====================================
Press 'Y' to start!
Remember to press it at the start of the sum!
You will need to do the first question before starting it
(Start the bot on the second question)
"""
header=Label(root,text=text, font=("TkFixedFont"),justify='left')
header.grid(column=0,row=0)
scrollbar = Scrollbar(root)
scrollbar.grid(column=5,row=0,sticky='ns')
mylist = Listbox(root, yscrollcommand=scrollbar.set)
l1 = Label(root, text='Delay: ')
l1.grid(column=0,row=3,sticky='w')
delayEntry = Entry(root,width=4)
delayEntry.grid(column=1,row=3,sticky='w')
b1 = Button(root, text='Set', command=mainthread.setDelay)
b1.grid(column=2,row=3,sticky='w')
mylist.grid(column=3,row=0,sticky='nsew')
scrollbar.config(command=mylist.yview)
root.rowconfigure(1, weight=1)
root.columnconfigure(1, weight=1)
mainloop()
What it gave me:
A rubbish looking gui with incorrectly sizing and expanding widgets
bad
What i want:
A good looking gui with correct sizing and expansion of widgets.
good
New contributor
Oliver Seymour is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.