From: "T. Kurt Bond" <tkb@tkb.mpl.com>
> I noticed that all the ?width options and ?height options for things
> like Label.create and Canvas.create have type int; Why don't these
> actually have type Tk.units so that one can specify them in any of the
> normal Tk screen units: Inches, Millimeters, Centimeters, Points, or
> Pixels, just like you can using raw Tcl/Tk or OcamlTk ?
The answer is in the LablTk section of the manual:
27.1 Module Tk: basic functions and types for LablTk
Dimensions
type units = [`Pix int|`Cm float|`In float|`Mm float|`Pt float]
val pixels : units -> int
Converts various on-screen units to pixels, respective to the
default display. Available units are pixels, centimeters, inches,
millimeters and points
Having to write units always explicitly was just a pain. This way you
can either write directly in pixels, or convert from another unit.
There is a very small glitch: if your application is intended to run
on several displays with different dpi's, you must use the
Winfo.pixels or Winfo.fpixels functions.
---------------------------------------------------------------------------
Jacques Garrigue Kyoto University garrigue at kurims.kyoto-u.ac.jp
<A HREF=http://wwwfun.kurims.kyoto-u.ac.jp/~garrigue/>JG</A>
This archive was generated by hypermail 2b29 : Fri Apr 28 2000 - 12:07:06 MET DST