Mar-08-2021, 04:23 PM
You could build a new menu. That may be the easiest way since you can probably do this without changing any of the code, just pass in a different set of labels.
You can configure menu entries, just like buttons and labels and the like. This code changes a "Quit" label to "Exit" in the file_menu.
You can configure menu entries, just like buttons and labels and the like. This code changes a "Quit" label to "Exit" in the file_menu.
import tkinter as tk root = tk.Tk() menubar = tk.Menu(root) file_menu = tk.Menu(menubar, tearoff=False) file_menu.add_command(label='Print', command=lambda: print("Hello World")) file_menu.add_command(label='Quit', command=quit) menubar.add_cascade(label='File', menu=file_menu) root.configure(menu=menubar) file_menu.entryconfig(1, label='Exit') root.mainloop()