| Previous | Next
Size of WidgetYou can use the following methods to find out the size of a widget in several different ways. Widget's GeometryThe $geom = $widget->geometry; The geometry string was discussed in detail in " 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 Requested HeightThe $height = $widget->reqheight; Requested WidthThe $width = $widget->reqwidth; Actual WidthTo get the width of the widget as it currently is drawn, use the $cur_width = $widget->width; When the widget is first created, Actual HeightTo get the current height, use the $h = $widget->height; Just like the |