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: Pascal Rigaux <pixel_@g...>
Subject: 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...

Precision: i can't use Pixels by default 'cuz it's int and not float and so
isn't precise enough... That's why i use Millimeters. But when i ask something
to tk, it answers in Pixels (eg: winfo reqwidth, ev_MouseX, winfo width)

PS: the prog i'm writing is a function plotting tool (a la gnuplot), math
oriented. The code is on

cu Pixel.

En francais (dingue ce que je suis courageux :)

Donc :

Je cherche a convertir des Pixels en Millimeters (type units) dans un canvas.
La fonction qui semble faire ca en tk, c'est "tk scale" mais je l'a trouve pas
des ocamltk41 :(

Je pourrais faire sans (un bete facteur 3.66, par defaut), mais je me demande si
il y aurait pas mieux et plus propre...

Precision: je peux pas utiliser les Pixels parce que c'est des int et c'est pas
assez precis... Conclusion j'utilise des Millimeters. Mais quand je pose des
questions a tk, il repond en int alias Pixels (ex: winfo reqwidth, ev_MouseX,
winfo width)

PS: le prog que j'ecris sert a tracer des courbes (a la gnuplot), mais oriente
math. Par exemple il gere x=2, les inequations (hachures) et les tangentes. Le
code se trouve sur

a+ Pixel.