I've tried for several hours to build a Frame that fills the window, and which contains a Listbox on one side and three buttons evenly spaced: how I want the layout to be
Instead, with the current code I have, the result looks like this
Can anyone point out what I'm doing wrong, and how I can change the code to get it to the way I want it to be?
Current code: `
# Creates window
root = Tk()
root.title("MyMemory")
root.geometry("600x600")
root["bg"] = "sienna1"
# Frames the window
mainframe = ttk.Frame(root, padding="3 3 12 12")
mainframe.grid(column=0, row=0, sticky=(N, W, E, S))
mainframe.columnconfigure(0, weight=1)
mainframe.rowconfigure(0, weight=1)
mainframe.pack(fill=BOTH, expand = True)
# Creates Listbox of existing subjects, from .txt files in directory of
program
subjects = Listbox(mainframe)
for file in glob.glob("*.txt"):
subjects.insert(0,file.split('.')[0])
subjects.grid(column = 0, row = 1, rowspan = 3)
# Creates a button for selecting the subject in the Listbox
select_subject = Button(mainframe, text = 'Select subject', command =
lambda: subject_menu(subjects, root))
select_subject.grid(column = 1, row = 0, sticky = (N))
# Creates a "make new subject" button
make_subject = Button(mainframe, text = 'Make new subject', command =
lambda: new_subject(root))
make_subject.grid(column = 1, row = 1, sticky = (N))
# Creates an "import subject" button
import_sub = Button(mainframe, text = 'Import a subject', command =
import_subject)
import_sub.grid(column = 1, row = 2, sticky = (N))
# Creates an "exit program" button
#close = Button(root, text = 'Exit program', command = ))
#close.pack(pady=20, padx = 20)
# Starts the loop
root.mainloop()`