Im trying to get this menu to be inside my of my canvas but so far ive only had 2 windows open and now all im getting is an error, any help is greatly appreciated
Im using Tkinter as my GUI
from Tkinter import *
def startMenu():
top_tk = Tk()
top_tk.title("Checkers")
top = Canvas(width="800", height="800")
## Creates the black and white square background
size = 100
cols = 8
rows = 8
squareList = []
for i in range(cols):
for j in range(rows):
if j%2: colours = ["black", "white"]
else: colours = ["white", "black"]
squareList.append(top.create_rectangle(i*size, j*size,
i*size+size, j*size+size,
fill=colours[i%2]))
## Creates the Checkers Heading
frame1 = Frame(top, relief=GROOVE, borderwidth=2)
label1 = Label(frame1, text='Checkers', font=('Arial', 48), fg="blue")
label1.pack(side="left")
top.create_window(540, 300, window=frame1, anchor=SE)
top.pack(fill='both', expand='yes')
## Creates the Start Button
frame2 = Frame(top, relief=GROOVE, borderwidth=2)
button1 = Button(frame2, text='Start', font=('Arial', 28), fg="blue")
button1.pack(side="left")
top.create_window(457, 450, window=frame2, anchor=SE)
top.pack(fill='both', expand='yes')
## Creates the Option Button
frame3 = Frame(top, relief=GROOVE, borderwidth=2)
button2 = Button(frame3, text='Options', font=('Arial', 28), fg="blue")
button2.pack(side="left")
top.create_window(480, 550, window=frame3, anchor=SE)
top.pack(fill='both', expand='yes')
## Creates the Help Button
frame4 = Frame(top, relief=GROOVE, borderwidth=2)
button3 = Button(frame4, text='Help', font=('Arial', 28), fg="blue")
button3.pack(side="left")
top.create_window(458, 650, window=frame4, anchor=SE)
top.pack(fill='both', expand='yes')
## Creates the Exit Button
frame5 = Frame(top, relief=GROOVE, borderwidth=2)
button4 = Button(frame5, text='Quit',command=quit, font=('Arial', 28), fg="blue")
button4.pack(side="left")
top.create_window(455, 750, window=frame5, anchor=SE)
top.pack(fill='both', expand='yes')
## Not working
menubar = Menu(top)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="New")
filemenu.add_command(label="Open")
filemenu.add_command(label="Save")
filemenu.add_command(label="Save as...")
filemenu.add_command(label="Close")
filemenu.add_separator()
filemenu.add_command(label="Exit", command=top.quit)
menubar.add_cascade(label="File", menu=filemenu)
top.config(menu=menubar)
## Runs the mainloop
top.mainloop()
## Runs the program
startMenu()