Q: how to change menubar background color

Discussion in 'Python' started by Itay L., Jul 4, 2004.

  1. Itay L.

    Itay L. Guest

    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")
    menu.add_cascade(label="File", command=None)

    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 :(

    Itay L., Jul 4, 2004
    1. Advertisements

  2. Itay L.

    Jeff Epler Guest

    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).


    Version: GnuPG v1.2.4 (GNU/Linux)

    -----END PGP SIGNATURE-----
    Jeff Epler, Jul 4, 2004
    1. Advertisements

  3. Itay L.

    Itay L. Guest

    Thanks for the reply Jeff.

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

    Itay L., Jul 5, 2004
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.