<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/10/395a9d13766063bfb8e7d8934ad2ef7e"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-10-21T01:38:41"
  subject="Re: [Caml-list] Camltk: missing State Hidden constructor"
  prev="2003/10/e99830e14620d1d7fb16fb045d6406c6"
  next="2003/10/2bab59b83e55438d077c5e7dfa642b85"
  prev-in-thread="2003/10/ef0d2fcb8d3e24e64d0311d6f2b80da6"
  prev-thread="2003/10/71219d18280cf90894b34e1a9fcc1689"
  next-thread="2003/10/a168144e7f63d0942abad7a97c0558d4"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Camltk: missing State Hidden constructor">
<msg 
  url="2003/10/ef0d2fcb8d3e24e64d0311d6f2b80da6"
  from="Arnaud Rouanet &lt;arnaud.rouanet@i...&gt;"
  author="Arnaud Rouanet"
  date="2003-10-17T10:13:25"
  subject="[Caml-list] Camltk: missing State Hidden constructor">
<msg 
  url="2003/10/395a9d13766063bfb8e7d8934ad2ef7e"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2003-10-21T01:38:41"
  subject="Re: [Caml-list] Camltk: missing State Hidden constructor">
</msg>
</msg>
</thread>

<contents>
From: Arnaud Rouanet &lt;arnaud.rouanet@inria.fr&gt;

&gt; We wanted to use Canvas.configure_text, which accepts an State state
&gt; option, where state may only be Active | Normal | Disabled. We checked
&gt; the Tcl/Tk documentation and there is an additional "hidden" state
&gt; since version 8.3, which would be perfect for our purpose but this
&gt; doesn't appear in the current Camltk version.  It seems the previous
&gt; developper used a trick for this: in his modified version of Camltk,
&gt; the constructor Hidden has been added and then everything just works
&gt; fine.
[..]
&gt; Therefore, we would like to know if there is another way to
&gt; dynamically hide the text, using the standard Camltk distribution.  It
&gt; is rather strange that the State Hidden constructor is not available
&gt; 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

</contents>

</message>

