16.5. Widget Existence

To determine if a widget has been created, use Exists($widget):

if (Exists($widget)) {
   ...
}

Note the uppercase "E" on this method. The Exists method is different from the built-in Perl exists method. Make sure you don't confuse the two.

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.