[Tkinter-discuss] Change menubar color?

Juan Christian juan0christian at gmail.com
Mon Oct 27 21:42:59 CET 2014


from tkinter import *

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

menubar = Menu(root, background='#374140', foreground='black',
activebackground='#374140', activeforeground='black')
filemenu = Menu(menubar, tearoff=0, background='#374140',
foreground='#D9CB9E', activebackground='#D9CB9E',
activeforeground='#374140')
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()

---

Ok, it's somewhat working, but the menu isn't colored yet, just the
'filemenu'.

[image: Inline image 1]

On Mon, Oct 27, 2014 at 6:35 PM, Alejandro Autalan <
alejandroautalan at gmail.com> wrote:

> 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/de3dc51c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 92599 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tkinter-discuss/attachments/20141027/de3dc51c/attachment-0002.png>
-------------- 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/de3dc51c/attachment-0003.png>


More information about the Tkinter-discuss mailing list