Tkinter option cursor in Menu class Tkinter option cursor in Menu class tkinter tkinter

Tkinter option cursor in Menu class


The docs for tkinter Menu state that the cursor option denotes "The cursor that appears when the mouse is over the choices, but only when the menu has been torn off". So, I don't think you can actually do what you want. Only when your sub menu has been detached (torn off), you can see your cursor changing. Here is a Demo.

import tkinter as tkclass Settings:  def __init__(self, master):    # Elements of the menu    self.master=master    self.menu = tk.Menu(root, fg="red")    self.subMenu = tk.Menu(self.menu, cursor="plus")  def openMenu(self):    # Configuration of the menu    self.menu.add_cascade(label="Options", menu=self.subMenu)    self.addOptionsSubMenu()    self.master.config(menu=self.menu)  def addOptionsSubMenu(self):    # Add elements at the sub menu    self.subMenu.add_command(label="Quit", command=self.quit)    self.subMenu.add_command(label="Do nothing", command=self.passa)  # Quit the function  def quit(self):    exit()  # Do nothing  def passa(self):    passroot = tk.Tk()app = Settings(root)app.openMenu()root.mainloop()

Demo