Size

Most widgets have a width and height attribute that specifies their desired size, although there are some special cases. In all cases, the geometry manager for a widget might modify the size to some degree. The winfo operations described on page 573 return the current size of a widget.

Most of the text-related widgets interpret their sizes in units of characters for width and lines for height. All other widgets, including the message widget, interpret their dimensions in screen units, which are pixels by default. The tk scale command, which is described on page 582, controls the scale between pixels and the other measures. You can suffix the dimension with a unit specifier to get a particular measurement unit:

 c centimeters i inch m millimeters ...

Get Practical Programming in Tcl & Tk, Third Edition 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.