16.6. Is the Widget Mapped?

To find out if the widget has been mapped to the screen, use the ismapped method:

if ($widget->ismapped())
  # Do something
} else {
  # map the widget
}

The ismapped method returns 1 if the widget is currently mapped to the screen and if it is not.

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.