If I create a tkinter menu in OS X and try to add a menu button to it with add_comand() , nothing will appear on the menu.
If the code below is running on Ubuntu, I get a menu with two commands labeled Red and Blue that change the background color of the window.
On OS X 10.10.1 (Yosemite), buttons are not displayed. I know that I can create a drop-down menu with red and blue commands, but in my real application, I would prefer not to.
from platform import python_version_tuple major = python_version_tuple()[0] if major == '3': import tkinter as tk else: import Tkinter as tk root = tk.Tk() fr = tk.Frame(root, height = 200, width = 200) fr.pack() menu = tk.Menu(root) root.configure(menu=menu) menu.add_command(label='Red', command=lambda:fr.configure(bg='red')) menu.add_command(label='Blue', command=lambda:fr.configure(bg='blue')) root.mainloop()
Can you tell me how to do what I want?
source share