Search code examples
pythontkintercolorsbackgroundoptionmenu

Is there a way to change the background of an option menu in tkinter?


I'm having trouble with changing the background color of tkinter's option menus. When I say background, I am not talking about the color of the option menu, but the color of its actual background. My tkinter window's background is gray, so when I add an option menu, it is surrounded by a few wite pixels. This doesn't happen with button or anything else that I'm aware of. Is there a way to fix this ?

Here is an image of the problem:


Solution

  • Okay everyone I found out how to do it by printing the option menu's config and looking through all the parameters. Turns out I had to add this:

    <widget ref>.config(bg = "gray", highlightthickness = 0)