vikee has asked for the wisdom of the Perl Monks concerning the following question:

hello, how can I get the background color of my program? $mw->configure(-background); doesn't work...

Replies are listed 'Best First'.
Re: TK: bgcolor
by eserte (Deacon) on Jul 22, 2004 at 15:06 UTC
    This works for me (Tk800 and Tk804, both on Linux):
    use Tk; $mw=tkinit; $mw->configure(-background => "red"); MainLoop;
Re: TK: bgcolor
by mscerra (Monk) on Jul 22, 2004 at 15:14 UTC
    vikee,

    This also works for me on Windows. Do you have a frame or other objects covering the whole area? If so the background might have changed but the frame is covering it and has not changed colors. Therefore you would not see the change of color.

Re: TK: bgcolor
by MidLifeXis (Monsignor) on Jul 22, 2004 at 17:11 UTC

    get or set? It looks like the first two answers are doing a set, but the OP says get.

      Whoops! I definitely missed that.

      The correct command to get the color is $mw->cget(-background).