in reply to How to set background Color on bitmap when creating with DefineBitmap?

This should be simple, but I can't seem to get it...

Start by posting a complete program

How (Not) To Ask A Question

  • Comment on Re: How to set background Color on bitmap when creating with DefineBitmap?

Replies are listed 'Best First'.
Re^2: How to set background Color on bitmap when creating with DefineBitmap?
by cmv (Chaplain) on Jul 14, 2010 at 21:40 UTC
    Here's a quick example:
    use strict; use warnings; use Tk; my $top = MainWindow->new(); my $arrowDnBits = pack("b8" x 5, "........", ".111111.", "..1111..", "...11...", "........" ); $top->DefineBitmap('arrowDn' => 8, 5, $arrowDnBits); $top->Button(-bitmap=>'arrowDn')->pack(-side=>'left'); MainLoop();
    Note: It is possible to set -background=>'red' when you create the button (which will get the button code to go and set the bitmap background for you), but that is not what I want. I'm trying to figure out how to set the bitmap -background directly, or possibly another bitmap option like -data.