10.2. Erase a display?

To erase something like a bitmap call delete on the item. Assuming your Canvas tag is $canvar and your item tag it $bittag (as in the previous [10.1] question) then the call proceeds like:

    $canvar -> delete($bittag);
This is of course useful in a callback. For example to configure a Button to do your deletion for you you could say something like:
    $main->Button(-text   => 'clear', 
                  -command=>sub{$canvar -> delete($bittag)}
                 )->pack;

Previous | Return to table of contents | Next