from tkinter import Tk from tkinter import Menu from tkinter import Frame gyoker = Tk() def hello(): print("Helló") menu = Menu(gyoker, tearoff=0) menu.add_command(label="Visszavonás", command=hello) menu.add_command(label="Ismétlés", command=hello) frame = Frame(gyoker, width=512, height=512) frame.pack() def popup(event): menu.post(event.x_root, event.y_root) frame.bind("", popup) gyoker.mainloop()