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

Widget’s ID

You use the id method to get X11 window ID or Win32 HWND for a widget:

$id = $widget->id;
print "$id\n";
# Prints 0x9c944c

This returns a hex value. A common use for this method is to embed a Tk window in another application. The PerlPlus Netscape plug-in does just this. It is described in Chapter 22.

Widget’s PathName From Its X11 ID

You can get the PathName of the window by calling pathname andusing the ID you retrieved with the id method:

$path = $widget->pathname($id);

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