Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
tk scale
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Rouaix <frouaix@l...>
Subject: Re: tk scale
> I'm looking for something to convert the Pixels units to Millimeters in a canvas.
> Seems like the tk function is "tk scale", but i can't find it in ocamltk41 :(
> I could do without it (seems like by default there is 3.66 factor between the
> 2), but i wonder if it could be done another way...

Yes, unfortunately, we may have missed some functions in ocamltk41, and 
miss most of the functions added in Tcl/Tk 8.0.
There is always the solution of adding entries in the Widgets.src file of
the ocamltk distribution, or simply create new .src files and apply the
"tkcompiler" to generate the stubs.
In this case, I would expect that something like

module tkscale {
  function (float) get ["tk"; "scale"]
  function () set ["tk"; "scale"; float]

would be enough to lift the "tk scale" command. However, a brief look
at Welch's book does not confirm that this command can be used to do
what you describe (eg converting from Pixels to Millimeters).