0

Good morning I wanted to request an example of how to use the stile layout function, and what are the functions, an example appears in the documentation but I do not understand.

from tkinter import ttk import tkinter

root = tkinter.Tk()

style = ttk.Style()
style.layout("TMenubutton", [
   ("Menubutton.background", None),
   ("Menubutton.button", {"children":
       [("Menubutton.focus", {"children":
           [("Menubutton.padding", {"children":
               [("Menubutton.label", {"side": "left", "expand": 1})]
           })]
       })]
   }),
])

mbtn = ttk.Menubutton(text='Text')
mbtn.pack()
root.mainloop()

but I do not understand what the parameters are or if they know of a blog where they are explained. Thanks

Bryan Oakley
  • 341,422
  • 46
  • 489
  • 636

0 Answers0