You can use the following methods to find out the size of a widget in several different ways.
$geom = $widget->geometry;
The geometry string was discussed in detail in Chapter 11, " Frame, MainWindow,and Toplevel Widgets". Geometry values are typically specified in pixels. An exception is a child widget that uses characters as its normal units, such as a Text or Listbox, with -setgrid => 1 specified. In this case, the window manager forces a geometry in integral lines and characters.
$height = $widget->reqheight;
$width = $widget->reqwidth;
$cur_width = $widget->width;
When the widget is first created, width will return a 1 until the application has finished drawing everything. After that, it will return the actual width of the widget.
$h = $widget->height;
Just like the width method, height returns a 1 when the widget is first created. You can use the update or afterIdle method to force everything else to happen and then call height or width to get the finished values.