Python Forum
Adding a sub menu to a ttk.OptionMrnue ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding a sub menu to a ttk.OptionMrnue ?
#5
Hi,
Thanks for the response but it's not quite what I wanted.

This is how I create my main drop down menu which works fine, I hope it helps.
I wanted to add a submenu to Item6, which are: sub1 and sub2


Var1 = tk.StringVar(Fbtn1)
list=[' Item1 ) ',' Item2 ',' Item3 ',' Item4 ',' Item5 ',' Item6 ) ']

Mbtn1 = ttk.OptionMenu(Fbtn1, Var1, list[2], *list,style= 'O.TLabel',
command = (Dropdown_Main_Menu))
Mbtn1['menu'].configure(background= 'lightgray') # Change Menu Background Colour

Any advise how to add a submenu to the code would be most appreciated.

Robo
Reply


Messages In This Thread
Adding a sub menu to a ttk.OptionMrnue ? - by Robo - Apr-16-2024, 10:31 AM
RE: Adding a sub menu to a ttk.OptionMrnue ? - by Robo - Apr-17-2024, 12:51 PM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020