Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TKinter: Can I style submenus to look like normal menus

Tags:

python

tkinter

I am using from tkinter.ttk import * to override the old windows 98 style with the new windows 8 styled widgets. When I create a menu, it is styled as a new menu:

menu = Menu(master)

But when I add a submenu, it is styled as a old menu:

fileMenu = Menu(self, tearoff=False)
menu.add_cascade(label="Bestand", menu=fileMenu)

It looks like this:

enter image description here

What I would like is something like this: enter image description here

Am I missing a import here, or is there a new ttk class for submenus? Please tell me.

like image 228
yyny Avatar asked Mar 07 '15 14:03

yyny


1 Answers

The themeing enhancements to Tk (ttk) did not cover any changes to the menu items. These are being provided by the system on Windows so typically follow the windows standard look and feel. However, they use the older XP style menu look and feel and do not pick up the Vista/Win7 themed elements. The menubar itself is drawn by the Windows UI frame so has slightly different rules being applied.

As this is not implemented in Tk it is not available in Tkinter either. Sorry.

like image 174
patthoyts Avatar answered Nov 07 '22 04:11

patthoyts