473,320 Members | 2,104 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Q: how to change menubar background color

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.
Jul 18 '05 #1
2 5893
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)

iD8DBQFA6BPNJd01MZaTXX0RAvjPAJ9rdYFmusrjGZ2TIl2dlT YRLl+faQCfZJ5E
0Bx08LS4ve1sRrqbnViblT8=
=ZiR1
-----END PGP SIGNATURE-----

Jul 18 '05 #2

Thanks for the reply Jeff.
I will try to create a non native menubar as you suggested.

Itay.

Jeff Epler <je****@unpythonic.net> wrote in
news:ma**************************************@pyth on.org:
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

Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
by: Code Monkee | last post by:
How can the toolbar and menubar be hidden in IE? When opening the window via javascript I can specify 'toolbar=no,menubar=no', which works fine. However if the window already exists how can I...
4
by: Nathan Given | last post by:
Hello All, I am trying to randomly change the background image of my home page but I can't seem to figure it out. Here is a snippet of my css .... BODY {background:transparent...
1
by: Richard Hollenbeck | last post by:
I'm building custom menubars for my application--a different one for each form. When I right-click on a menubar and select Customize and click on the toolbars tab, the menubar called "Menu Bar"...
8
by: Jho | last post by:
Is it wise to do the following to hide html source and other info. I plan to do a popup window which would close my existing web page and popup a window in its place without toolbar and...
2
by: A.J. Pool | last post by:
I have a form with a main menubar containing a number of menu options. In the empty right half of the menubar I want to place a combobox where users can make some sort of selection. However, when...
1
by: Simon Wigzell | last post by:
I have a picture gallery webpage. Naturally I want as much space as possible for the pictures but with browsers these days the actual available area is only 2/3 - 3/4 of the total window. So I have...
5
by: sierra7 | last post by:
Hi I have been writing Access applications for some years now and have moved away from from the 'Switchboard' type of opening form to using a menubar accross the top of the screen and borderless...
10
by: The Bicycling Guitarist | last post by:
Hello. I have a navigation bar at the top of all my pages with css-styled buttons that change color when hovered over. I am a little confused on how to disable that for the link that the page is...
2
by: mjrtom19 | last post by:
I have a Jframe using a menubar to determine the color and shape of a graphics2d object, at the moment the color stays red no matter what. I think the problem is in the itemListener in the inner...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.