Trying to add menu option using tkinter Trying to add menu option using tkinter tkinter tkinter

Trying to add menu option using tkinter


Create a tk.Menu and add commands using menu.add_command. Read here for more information about tkinter menus and how to do things like adding submenus. For your code, you can add a menu like this:

...tk.Tk.__init__(self)#self._GUID()self.x = self.y = 0self.menu = tk.Menu(self)self.menu.add_command(label = "Menu command name", command = self.doSomething)self.config(menu = self.menu)self.canvas = tk.Canvas(self, width=512, height=512, cursor="cross")...