Copyright © 2008, 2009 Arndt Roger Schneider
Resolution Independent Dimensions
»p« is a abbreviation for point. meaning the 72th part of an inch. This is the default measurement for fonts.
Metric measurements »c« := centimeter and »m« := millimeter.
Measured in »Inch«.
Example 7.6. Using Resolution Independent Measurement
# Button border with one point. option add *Button.borderWidth 1p # Internal 2mm white space. option add *Button.padX 2m # A 20 point height font for buttons. option add *Button.font \ {{bitstream vera sans} 20}
Test the resolution independence for a new application. Use »tk scaling« for testing the resolution independence. Keep in mind tk scaling doesn’t work under AQUA®!
Example 7.7. Test Resolution Independency
# Start wish from a terminal application: /usr/bin/wish # set scaling to factor 2, resembling 144ppi. tk scaling 2.0; source »the application«
Use »winfo pixels« to translate a resolution independent value into it its pixel equivalent. This is necessary for all TkPath items.