Tk Optionmenu foreground colors

Tk Optionmenu foreground colors

am 06.12.2007 18:16:13 von gilgames

May be somebody could help me out.

I use Tk the version from 2004. I have to make a change which allows
black background (same people see it better). I was successful with all
the widgets, except Optionmenu. I can change the -background option, but
the -foreground (text color) is always black or some kind of gray.
-activeForeground is rejected when the program is loaded. I see the
highlighted foreground (when the cursor is over the widget or selection)
but do not see options in not highlighted state.

here is the command I use


$parwidget[$i]->Optionmenu(-options=>\@optarray,-textvariabl e=>$myvariable,
-takefocus=>1,-font=>$myfont,
-background=>"black",-foreground=>"white",
-command=>sub{"myfunc()")});

Everything works fine since years except the -foreground color

Thanks in advance

Re: Tk Optionmenu foreground colors

am 07.12.2007 12:10:39 von gilgames

<<
I use Tk the version from 2004. I have to make a change which allows
black background (same people see it better). I was successful with all
the widgets, except Optionmenu. I can change the -background option, but
the -foreground (text color) is always black or some kind of gray.
-activeForeground is rejected when the program is loaded. I see the
highlighted foreground (when the cursor is over the widget or selection)
but do not see options in not highlighted state.

>>

The above is my problem. I found some halfway resolution. If I edit
Optionmenu.pl in site/lib/Tk folder inserting

-foreground => [['SELF', 'CHILDREN'], undef, undef, undef],



line to $w->ConfigSpecs( list, the the color of the button can be
changed. However the popupmenu color is still gray

Any idea is appreciated

laszlo