Q: how to change menubar background color

I

Itay L.

Dear all,

I am trying to figure out how to change the background color of my
menubar under Windows.

I've tried the following:

from Tkinter import *

root = Tk()
menu = Menu(root,background="blue")
root.config(menu=menu)
menu.add_cascade(label="File", command=None)
root.mainloop()



but its a no go.



Maybe I should post a direct tk command or change the default
"SystemButtonFace" color.

Or maybe its impossible - but I was told nothing is impossible so this
may be traumatic for me :(


TIA.
 
J

Jeff Epler

Tk uses the native windows menu control to draw the menubar. This may
mean you're unable to change it. If background= doesn't work, well,
you're probably stuck.

You can use a non-native menubar by creating a menu frame and packing a
bunch of menubuttons into it, but this won't look as nice as a native
menu, and probably won't work with the predefined alt-key bindings
(alt+f = file, etc).

Jeff

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA6BPNJd01MZaTXX0RAvjPAJ9rdYFmusrjGZ2TIl2dlTYRLl+faQCfZJ5E
0Bx08LS4ve1sRrqbnViblT8=
=ZiR1
-----END PGP SIGNATURE-----
 
I

Itay L.

Thanks for the reply Jeff.


I will try to create a non native menubar as you suggested.

Itay.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top