I'm building a Tkinter application and it's almost complete except for some aesthetic tweaks. I managed to customize almost all elements except for this Menu
widget. In the first image below, you can see font
, bg
arguments doesn't do anything, although the same arguments work in the sub-menu. (see the second image)
Here's the code snippet:
root = Tk(className=r" Movie and TV Shows Recommendation System") # creates a window in which we work our gui
root.geometry('960x720') # width x height
root.resizable(width=False, height=False) # restricts window size
# 'font', 'bg' arguments doesn't do anything here (see first image)
menu = Menu(root, font='Courier 12', bg='black')
# although it works here (see second image)
helpMenu = Menu(menu, tearoff=0, font='Courier 11', bg='yellow', activebackground='black', activeforeground='white')
menu.add_cascade(label='Menu', menu=helpMenu)
helpMenu.add_command(label='How it Works?', command=open_popup)
helpMenu.add_separator()
helpMenu.add_command(label='See project in GitHub...', command=lambda: webbrowser.open_new("someurl.com"))
helpMenu.add_separator()
helpMenu.add_command(label='Donate via PayPal...', command=lambda: webbrowser.open_new("https://someurl.com"))
helpMenu.add_separator()
helpMenu.add_command(label='Exit', command=root.destroy)
I also tried menu.config(bg='black')
, didn't do the trick. If you know any other way to customize this, please let me know. Thanks!