from tkinter import *
# Create the main window
root = Tk()
root.title("Hancie e-Learning Studio")
root.geometry("500x300")
# Create a context menu
context_menu = Menu(root, tearoff=0)
def handleClick():
print("Hello Hancie!")
# Add some options to the context menu
context_menu.add_command(label="Option 1", command=handleClick)
context_menu.add_command(label="Option 2", command=handleClick)
context_menu.add_separator()
context_menu.add_command(label="Quit", command=root.quit)
# Bind the context menu to the root window
root.bind("
<Button-3>", lambda event: context_menu.post(event.x_root, event.y_root))
# Start the main event loop
root.mainloop()
Output