home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Book HomeMastering Perl/TkSearch this book

13.9. Size of Widget

You can use the following methods to find out the size of a widget in several different ways.

13.9.1. Widget's Geometry

The geometry method returns the geometry string for the widget in the form of width x height + x + y.

$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.



Library Navigation Links

Copyright © 2002 O'Reilly & Associates. All rights reserved.