10.1. Display a bitmap?

Unlike other widgets the Canvas does not take the -bitmap configuration option. One of the ways to place things - including bitmaps - onto a Canvas is to call create on it. To emphasize how a Canvas handles bitmaps differently from the configurable widgets let me assume that you wanted to specify the 'hourglass' built in bitmap in the following. (For more on xbm file specification see a previous question [9.8] within this FAQ.) Here is a way to combine the Canvas; and create; calls:

    my($canvar) = $main->Canvas();
    my($bittag) = $canvar->create('bitmap',10,10, -bitmap=>'hourglass');
    $canvar->pack;

Previous | Return to table of contents | Next