9.14. Deleting Items

To remove an item (or more than one item) from the canvas completely, use the deletemethod. It takes a list of tag or IDs to remove from the canvas. It will delete all matches it finds for the tag names, so be careful that you aren't deleting something you don't want to delete. Here is an example that uses three separate tag/IDs:

$canvas->delete("blue", "circle", $id_num);

You can specify only one tag/ID or as many as you want.

Get Learning Perl/Tk now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.