[Tkinter-discuss] Change menubar color?

Alejandro Autalan alejandroautalan at gmail.com
Mon Oct 27 21:35:16 CET 2014


2014-10-27 17:10 GMT-03:00 Juan Christian <juan0christian at gmail.com>:

> I have this simple code:
>
> from tkinter import *
>
> root = Tk()
> root.title("Steam Trader")
> root.minsize(500, 800)
> root.maxsize(500, 0)
>
> menubar = Menu(root)
> filemenu = Menu(menubar, tearoff=0)
> filemenu.add_command(label="Open", command=None)
> filemenu.add_command(label="Save", command=None)
> menubar.add_cascade(label="File", menu=filemenu)
>
> root.config(bg='#2A2C2B', menu=menubar)
> root.mainloop()
>
>
> And I want to change the menu color, is it possible?
>
> [image: Inline image 1]
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> https://mail.python.org/mailman/listinfo/tkinter-discuss
>
>
Hello, yes it is posible:

from tkinter import *

root = Tk()
root.title("Steam Trader")
root.minsize(500, 800)
root.maxsize(500, 0)

menubar = Menu(root, background='#000099', foreground='white',
               activebackground='#004c99', activeforeground='white')
filemenu = Menu(menubar, tearoff=0, background='#000099',
foreground='white',
                activebackground='#004c99', activeforeground='white')
filemenu.add_command(label="Open", command=None)
filemenu.add_command(label="Save", command=None)
menubar.add_cascade(label="File", menu=filemenu)

root.config(bg='#2A2C2B', menu=menubar)
root.mainloop()


Regards.
Alejandro A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20141027/bdff0fb6/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 12703 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20141027/bdff0fb6/attachment-0001.png>


More information about the Tkinter-discuss mailing list