The COLUMNS attribute, FONT attribute, and WIDTH common attribute are interdependent. Similarly, the ROWS attribute, FONT attribute, and HEIGHT common attribute are interdependent.
For Constant Widget Size:
If you want to place a widget in a PANEL or otherwise so that it will not grow to encroach on its neighbor widgets, set the values of WIDTH and HEIGHT to the desired numbers of pixels. ROWS and COLUMNS will adjust based on the value of the FONT attribute.
Setting the value of FONT will not change the size of a widget. WIDTH and HEIGHT set the exterior dimensions of the widget, whereas ROWS and COLUMNS affect only the work area dimensions.
Incompatible Attribute Values:
You do not have to worry about setting these values incompatibly, because the attribute you set last in your program will take precedence, as shown in the table above.
For example, if you set ROWS, COLUMNS, FONT, WIDTH, and HEIGHT in that order in your program, the widget will use your FONT, WIDTH, and HEIGHT values and will ignore your ROWS and COLUMNS values. Instead of using your values, the widget will automatically set the ROWS and COLUMNS attribute values.
|