This should be simple, but I can't seem to get it...
I want to create a bitmap with a particular background color. Here's how I create the bitmap:
my $arrowDnBits = pack("b8" x 5, "........", ".111111.", "..1111..", "...11...", "........"); $top->DefineBitmap('arrowDn' => 8, 5, $arrowDnBits);
Where do I specify -background=>'red' in the above code?
DefineBitmap doesn't return anything, so I can't access it that way and it doesn't allow any options on the command line either.
How do I do this?
Thanks
-Craig
When a bitmap image is created, Tk also creates a new command whose name is the same as the image. This command may be used to invoke various operations on the image. It has the following general form:
imageName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for bitmap images:
imageName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the image create bitmap command.
Unfortunately, none of these seem to work:
$top->configure(-bitmap=>'arrowDn', -background=>'red'); $top->image(-bitmap=>'arrowDn', -background=>'red'); $top->arrowDn(-background=>'red');
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |