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
[Caml-list] Camltk: missing State Hidden constructor
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-10-21 (01:38)
From: Jacques Garrigue <garrigue@k...>
Subject: Re: [Caml-list] Camltk: missing State Hidden constructor
From: Arnaud Rouanet <>

> 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 [| w; TkToken"configure"; TkToken"-hidden" |]

With labltk, you should be more explicit with the widget type intended.

  let hide (w : text widget) =
     Protocol.tkEval [| w; TkToken"configure"; TkToken"-hidden" |]

Of course your program becomes incompatible with versions older than 8.3.

Jacques Garrigue

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: