[Python] How to remove the border of a Tkinter OptionMenu Widget

Discussão em 'Python' iniciado por Stack, Julho 3, 2025.

  1. Stack

    Stack Membro Participativo

    I have been looking through multiple websites, which only give me a half satisfactory answer, how would I colour each part of of a Tkinter OptionMenu Widget?

    Code Snippet:

    from tkinter import *

    root = Tk()
    text = StringVar()

    fr = Frame (root,bg="yellow")
    fr.grid()

    menu = OptionMenu (fr, text, "hi", "there")
    menu.grid (pady=50, padx=50)

    # Pretty colouring goes here
    # Or ugly yellow, I don't mind

    menu ["menu"] ["bg"] = "yellow"
    menu ["bg"] = "yellow"
    menu ["activebackground"] = "green"

    root.mainloop()


    Or should I just give up and settle for grey?

    Continue reading...

Compartilhe esta Página