O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Deleting Items

You can use the delete method to delete items from the Listbox:

$lb->delete(firstindex 
            [, lastindex ]);

The first argument is the index from which to start deleting. To delete more than just that one item, you can add a second index. The firstindex must be less than or equal to the lastindex specified. To delete all the elements in the Listbox:

$lb->delete(0, 'end');

To delete the last item in the Listbox:

$lb->delete('end');

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required