* [Caml-list] Camltk: missing State Hidden constructor
@ 2003-10-17 10:13 Arnaud Rouanet
2003-10-21 1:38 ` Jacques Garrigue
0 siblings, 1 reply; 2+ messages in thread
From: Arnaud Rouanet @ 2003-10-17 10:13 UTC (permalink / raw)
To: caml-list; +Cc: julien.forget
Hi all,
We are developping an application (SynDEx at INRIA Rocquencourt) with
Ocaml and the Camltk library for the GUI.
In our software, the content of one of the windows, more precisely the
elements in the main canvas of the window, is automatically scaled
when the user resizes the window. The canvas contains several "text
vertices", which consist in text overlaping a rectangle, created by
Canvas.create_text, Canvas.create_rectangle. Initially, the rectangle
is approximately the bounding box of the text.
When scaling, for each text vertex, the rectangle is scaled down and
may become too small to contain the text, as the text itself is not
scaled. Therefore, when the rectangle becomes too small, we want to
make the text disappear, and when it becomes big enough, make it
reappear.
We wanted to use Canvas.configure_text, which accepts an State state
option, where state may only be Active | Normal | Disabled. We checked
the Tcl/Tk documentation and there is an additional "hidden" state
since version 8.3, which would be perfect for our purpose but this
doesn't appear in the current Camltk version. It seems the previous
developper used a trick for this: in his modified version of Camltk,
the constructor Hidden has been added and then everything just works
fine.
However, we are now working with other universities and we would like
to use the standard distribution of Ocaml, which contains CamlTk (but
without the Hidden constructor). This would also make it easier for
us to upgrade to new versions of Ocaml.
Therefore, we would like to know if there is another way to
dynamically hide the text, using the standard Camltk distribution. It
is rather strange that the State Hidden constructor is not available
in Camltk. Is there a good reason for this ?
Thanks for hints,
--
Julien Forget
Arnaud Rouanet
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Caml-list] Camltk: missing State Hidden constructor
2003-10-17 10:13 [Caml-list] Camltk: missing State Hidden constructor Arnaud Rouanet
@ 2003-10-21 1:38 ` Jacques Garrigue
0 siblings, 0 replies; 2+ messages in thread
From: Jacques Garrigue @ 2003-10-21 1:38 UTC (permalink / raw)
To: arnaud.rouanet; +Cc: caml-list, julien.forget
From: Arnaud Rouanet <arnaud.rouanet@inria.fr>
> We wanted to use Canvas.configure_text, which accepts an State state
> option, where state may only be Active | Normal | Disabled. We checked
> the Tcl/Tk documentation and there is an additional "hidden" state
> since version 8.3, which would be perfect for our purpose but this
> doesn't appear in the current Camltk version. It seems the previous
> developper used a trick for this: in his modified version of Camltk,
> the constructor Hidden has been added and then everything just works
> fine.
[..]
> Therefore, we would like to know if there is another way to
> dynamically hide the text, using the standard Camltk distribution. It
> is rather strange that the State Hidden constructor is not available
> in Camltk. Is there a good reason for this ?
The reason is that not everybody is using Tcl/Tk 8.3, so that having
it in by default would be unsafe.
An idea would be to generate from different description files for each
version of Tk, but this would loose binary compatibility (and need
some work).
So currently, everybody is limited to Tcl/Tk 8.0 functionality.
If your need is punctual, you can define wrap the function by hand in caml:
let hide w =
Protocol.tkEval [| Widget.name w; TkToken"configure"; TkToken"-hidden" |]
With labltk, you should be more explicit with the widget type intended.
let hide (w : text widget) =
Protocol.tkEval [| Widget.name w; TkToken"configure"; TkToken"-hidden" |]
Of course your program becomes incompatible with versions older than 8.3.
Jacques Garrigue
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-10-21 1:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-10-17 10:13 [Caml-list] Camltk: missing State Hidden constructor Arnaud Rouanet
2003-10-21 1:38 ` Jacques Garrigue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).