For Programmers: Free Programming Magazines  


Home > Archive > Tcl > July 2004 > tk_optionMenu menu colors









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author tk_optionMenu menu colors
Dmurray2

2004-07-23, 8:57 am

I can't seem to set the background and foreground colors of the popup menu
created by tk_optionMenu. Here is my code:

tk_optionMenu .gui.cycle cycle "00Z" "06Z" "12Z" "18Z"
gui.cycle configure -borderwidth 1 -activebackground white -background
blue -foreground white -highlightbackground blue

This configures the menu button, but the menu itself comes up with a grey
background and black foreground. I would like for it to use the same
background and foreground scheme as the button. Can anyone help me out?

Thanks


Bryan Oakley

2004-07-23, 3:58 pm

Dmurray2 wrote:

> I can't seem to set the background and foreground colors of the popup menu
> created by tk_optionMenu. Here is my code:
>
> tk_optionMenu .gui.cycle cycle "00Z" "06Z" "12Z" "18Z"
> gui.cycle configure -borderwidth 1 -activebackground white -background
> blue -foreground white -highlightbackground blue
>


Reread the tk_optionMenu man page and you'll see that it states the
command returns the path of the menu. For example:

set menu [tk_optionMenu .gui.cycle cycle "00Z" "06Z" "12Z" "18Z"]
$menu configure -borderwidth 1 ...

Dmurray2

2004-07-23, 3:58 pm

Thanks for the help. I'm kind of new to Tk and I didn't realize that you
could configure anything that has a path.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com